Rework build scan configuration (#4763)

This commit is contained in:
Nikita Salnikov-Tarnovski 2021-12-01 19:27:45 +02:00 committed by GitHub
parent b6aaa35813
commit 08e92a5374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 12 deletions

View File

@ -33,23 +33,32 @@ 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 // if GE access key is not given and we are in CI, then we publish to scans.gradle.com
val useScansGradleCom = isCI && geAccessKey.isEmpty() val useScansGradleCom = isCI && geAccessKey.isEmpty()
gradleEnterprise { if (useScansGradleCom) {
if (!useScansGradleCom) { gradleEnterprise {
server = gradleEnterpriseServer buildScan {
}
buildScan {
if (useScansGradleCom) {
termsOfServiceUrl = "https://gradle.com/terms-of-service" termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes" termsOfServiceAgree = "yes"
isUploadInBackground = !isCI
publishAlways()
capture {
isTaskInputFiles = true
}
} }
publishAlways() }
this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures } else {
publishIfAuthenticated() gradleEnterprise {
server = gradleEnterpriseServer
buildScan {
isUploadInBackground = !isCI
isUploadInBackground = !isCI this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
publishAlways()
capture { capture {
isTaskInputFiles = true isTaskInputFiles = true
}
} }
} }
} }