diff --git a/WordPress/build.gradle b/WordPress/build.gradle index 799a728041a7..c315e7f1a227 100644 --- a/WordPress/build.gradle +++ b/WordPress/build.gradle @@ -72,9 +72,10 @@ sentry { logcat.enabled = false } autoInstallation.enabled = false - includeSourceContext = true - autoUploadSourceContext = true includeDependenciesReport = false + + includeSourceContext = gradle.ext.isCi + includeProguardMapping = gradle.ext.isCi /* Sentry won't send source context or add performance instrumentations for debug builds so we can save build times. Sending events will still work in debug builds (if enabled in WPCrashLoggingDataProvider). @@ -196,7 +197,7 @@ android { targetCompatibility JvmTarget.fromTarget(libs.versions.java.get()).target } - flavorDimensions "app", "buildType" + flavorDimensions = ['app', 'buildType'] productFlavors { wordpress { @@ -300,7 +301,7 @@ android { checkGeneratedSources = true lintConfig file("${project.rootDir}/config/lint/lint.xml") baseline file("${project.rootDir}/config/lint/baseline.xml") - sarifReport = System.getenv('CI') ? true : false + sarifReport = gradle.ext.isCi } packagingOptions { diff --git a/build.gradle b/build.gradle index f623dbcc9e7e..f195d06b1204 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ measureBuilds { findProperty('appsMetricsToken') ) } - attachGradleScanId = System.getenv('CI')?.toBoolean() ?: false + attachGradleScanId = gradle.ext.isCi } allprojects { diff --git a/config/gradle/gradle_build_cache.gradle b/config/gradle/gradle_build_cache.gradle index e228570fb5e1..e126efe58013 100644 --- a/config/gradle/gradle_build_cache.gradle +++ b/config/gradle/gradle_build_cache.gradle @@ -1,6 +1,6 @@ // Only run build cache on CI builds. -if (System.getenv('CI')) { +if (gradle.ext.isCi) { buildCache { remote(HttpBuildCache) { url = "http://10.0.2.215:5071/cache/" diff --git a/config/gradle/gradle_build_scan.gradle b/config/gradle/gradle_build_scan.gradle index 3dcb900ee7f2..3cc0913ff88c 100644 --- a/config/gradle/gradle_build_scan.gradle +++ b/config/gradle/gradle_build_scan.gradle @@ -1,6 +1,6 @@ // Only run build scan on CI builds. -if (System.getenv('CI')) { +if (gradle.ext.isCi) { develocity { buildScan { termsOfUseUrl = 'https://gradle.com/terms-of-service' diff --git a/settings.gradle b/settings.gradle index 91c6fd427de2..b94b55d21474 100644 --- a/settings.gradle +++ b/settings.gradle @@ -16,6 +16,8 @@ plugins { id "com.gradle.develocity" version "3.18.1" } +gradle.ext.isCi = System.getenv('CI')?.toBoolean() ?: false + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories {