Skip to content

Commit c7eb065

Browse files
authored
Simplify develocity configuration (#15086)
1 parent 69843c2 commit c7eb065

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

settings.gradle.kts

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -54,55 +54,44 @@ val develocityAccessKey = System.getenv("DEVELOCITY_ACCESS_KEY") ?: ""
5454
// if develocity access key is not given and we are in CI, then we publish to scans.gradle.com
5555
val useScansGradleCom = isCI && develocityAccessKey.isEmpty()
5656

57-
if (useScansGradleCom) {
58-
develocity {
57+
develocity {
58+
if (useScansGradleCom) {
5959
buildScan {
6060
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
6161
termsOfUseAgree = "yes"
62-
uploadInBackground = !isCI
63-
64-
capture {
65-
fileFingerprints = true
66-
}
67-
68-
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
69-
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
70-
buildScanPublished {
71-
File("build-scan.txt").printWriter().use { writer ->
72-
writer.println(buildScanUri)
73-
}
74-
}
75-
}
7662
}
77-
}
78-
} else {
79-
develocity {
63+
} else {
8064
server = develocityServer
8165
buildScan {
82-
uploadInBackground = !isCI
8366
publishing.onlyIf { it.isAuthenticated }
8467

85-
capture {
86-
fileFingerprints = true
87-
}
88-
8968
gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) }
9069
gradle.startParameter.projectProperties["testJavaVM"]?.let { tag(it) }
9170
gradle.startParameter.projectProperties["smokeTestSuite"]?.let {
9271
value("Smoke test suite", it)
9372
}
73+
}
74+
}
75+
76+
buildScan {
77+
uploadInBackground = !isCI
9478

95-
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
96-
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
97-
buildScanPublished {
98-
File("build-scan.txt").printWriter().use { writer ->
99-
writer.println(buildScanUri)
100-
}
79+
capture {
80+
fileFingerprints = true
81+
}
82+
83+
if (!gradle.startParameter.taskNames.contains("listTestsInPartition") &&
84+
!gradle.startParameter.taskNames.contains(":test-report:reportFlakyTests")) {
85+
buildScanPublished {
86+
File("build-scan.txt").printWriter().use { writer ->
87+
writer.println(buildScanUri)
10188
}
10289
}
10390
}
10491
}
92+
}
10593

94+
if (!useScansGradleCom) {
10695
buildCache {
10796
remote(develocity.buildCache) {
10897
isPush = isCI && develocityAccessKey.isNotEmpty()

0 commit comments

Comments
 (0)