@@ -52,30 +52,24 @@ val develocityServer = "https://develocity.opentelemetry.io"
5252val isCI = System .getenv(" CI" ) != null
5353val develocityAccessKey = System .getenv(" DEVELOCITY_ACCESS_KEY" ) ? : " "
5454
55- // if develocity access key is not given and we are in CI, then we publish to scans.gradle.com
56- val useScansGradleCom = isCI && develocityAccessKey.isEmpty()
57-
5855develocity {
59- if (useScansGradleCom) {
60- buildScan {
61- termsOfUseUrl = " https://gradle.com/help/legal-terms-of-use"
62- termsOfUseAgree = " yes"
63- }
64- } else {
56+ if (develocityAccessKey.isNotEmpty()) {
6557 server = develocityServer
66- buildScan {
67- publishing.onlyIf { it.isAuthenticated }
58+ }
6859
60+ buildScan {
61+ if (develocityAccessKey.isNotEmpty()) {
6962 gradle.startParameter.projectProperties[" testJavaVersion" ]?.let { tag(it) }
7063 gradle.startParameter.projectProperties[" testJavaVM" ]?.let { tag(it) }
7164 gradle.startParameter.projectProperties[" smokeTestSuite" ]?.let {
7265 value(" Smoke test suite" , it)
7366 }
67+ } else if (isCI) {
68+ termsOfUseUrl = " https://gradle.com/help/legal-terms-of-use"
69+ termsOfUseAgree = " yes"
70+ } else {
71+ publishing.onlyIf { false }
7472 }
75- }
76-
77- buildScan {
78- uploadInBackground = ! isCI
7973
8074 capture {
8175 fileFingerprints = true
@@ -93,11 +87,10 @@ develocity {
9387 }
9488}
9589
96- if (! useScansGradleCom) {
97- buildCache {
98- remote(develocity.buildCache) {
99- isPush = isCI && develocityAccessKey.isNotEmpty()
100- }
90+ buildCache {
91+ remote(HttpBuildCache ::class ) {
92+ url = uri(" $develocityServer /cache/" )
93+ isPush = isCI && develocityAccessKey.isNotEmpty()
10194 }
10295}
10396
0 commit comments