Rework build scan configuration
@@ -33,26 +33,35 @@ val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: ""
// if GE access key is not given and we are in CI, then we publish to scans.gradle.com
val useScansGradleCom = isCI && geAccessKey.isEmpty()
+if (useScansGradleCom) {
gradleEnterprise {
- if (!useScansGradleCom) {
- server = gradleEnterpriseServer
- }
buildScan {
- if (useScansGradleCom) {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
- }
+ isUploadInBackground = !isCI
publishAlways()
- this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
- publishIfAuthenticated()
+ capture {
+ isTaskInputFiles = true
+ }
+ }
+ }
+} else {
+ gradleEnterprise {
+ server = gradleEnterpriseServer
+ buildScan {
isUploadInBackground = !isCI
+ this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
+ publishIfAuthenticated()
+ publishAlways()
+
capture {
isTaskInputFiles = true
}
}
}
+}
val geCacheUsername = System.getenv("GE_CACHE_USERNAME") ?: ""
val geCachePassword = System.getenv("GE_CACHE_PASSWORD") ?: ""
