Skip to content

Commit ed5e17e

Browse files
authored
Skip debug build when CI runs (getsentry#1666)
1 parent 19e4e77 commit ed5e17e

8 files changed

Lines changed: 46 additions & 0 deletions

File tree

buildSrc/src/main/java/Config.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ object Config {
3232
val compileSdkVersion = sdkVersion
3333

3434
val abiFilters = listOf("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
35+
36+
fun shouldSkipDebugVariant(name: String): Boolean {
37+
return System.getenv("CI")?.toBoolean() ?: false && name == "debug"
38+
}
3539
}
3640

3741
object Libs {

sentry-android-core/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ android {
5858
configurations.all {
5959
resolutionStrategy.force(Config.CompileOnly.jetbrainsAnnotations)
6060
}
61+
62+
variantFilter {
63+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
64+
ignore = true
65+
}
66+
}
6167
}
6268

6369
tasks.withType<Test> {

sentry-android-fragment/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ android {
4949
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
5050
isCheckReleaseBuilds = false
5151
}
52+
53+
variantFilter {
54+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
55+
ignore = true
56+
}
57+
}
5258
}
5359

5460
tasks.withType<Test> {

sentry-android-ndk/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ android {
8888
configurations.all {
8989
resolutionStrategy.force(Config.CompileOnly.jetbrainsAnnotations)
9090
}
91+
92+
variantFilter {
93+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
94+
ignore = true
95+
}
96+
}
9197
}
9298

9399
tasks.withType<Test> {

sentry-android-okhttp/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ android {
5050
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
5151
isCheckReleaseBuilds = false
5252
}
53+
54+
variantFilter {
55+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
56+
ignore = true
57+
}
58+
}
5359
}
5460

5561
tasks.withType<Test> {

sentry-android-timber/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ android {
5454
// We run a full lint analysis as build part in CI, so skip vital checks for assemble tasks.
5555
isCheckReleaseBuilds = false
5656
}
57+
58+
variantFilter {
59+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
60+
ignore = true
61+
}
62+
}
5763
}
5864

5965
tasks.withType<Test> {

sentry-android/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ android {
1919
// Determines whether to generate a BuildConfig class.
2020
buildConfig = false
2121
}
22+
23+
variantFilter {
24+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
25+
ignore = true
26+
}
27+
}
2228
}
2329

2430
dependencies {

sentry-samples/sentry-samples-android/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ android {
8383
kotlinOptions {
8484
jvmTarget = JavaVersion.VERSION_1_8.toString()
8585
}
86+
87+
variantFilter {
88+
if (Config.Android.shouldSkipDebugVariant(buildType.name)) {
89+
ignore = true
90+
}
91+
}
8692
}
8793

8894
dependencies {

0 commit comments

Comments
 (0)