Skip to content

Commit 16ecafa

Browse files
build: Upgrade from deprecated com.gradle.enterprise to com.gradle.develocity (#902)
1 parent 1923bac commit 16ecafa

File tree

1 file changed

+34
-8
lines changed

1 file changed

+34
-8
lines changed

settings.gradle.kts

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,44 @@ pluginManagement {
1313
}
1414

1515
plugins {
16-
id("com.gradle.enterprise") version("3.13")
16+
id("com.gradle.develocity") version "3.19.2"
1717
}
1818

19-
gradleEnterprise {
19+
develocity {
2020
buildScan {
21-
termsOfServiceUrl = "https://gradle.com/terms-of-service"
22-
termsOfServiceAgree = "yes"
21+
termsOfUseUrl = "https://gradle.com/terms-of-service"
22+
termsOfUseAgree = "yes"
23+
24+
// Automatically publish scans in CI
25+
publishing.onlyIf { !System.getenv("CI").isNullOrEmpty() }
26+
2327
capture {
24-
// Capture task inputs.
25-
isTaskInputFiles = true
28+
// https://docs.gradle.com/enterprise/gradle-plugin/current/#capturing_resource_usage
29+
resourceUsage.set(true)
30+
buildLogging.set(false)
31+
testLogging.set(false)
32+
}
33+
34+
obfuscation {
35+
username { _ -> "__redacted__" }
36+
ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
37+
externalProcessName { processName -> "__redacted__" }
38+
}
39+
40+
// Add custom values
41+
value("Project Name", rootProject.name)
42+
value("Build Branch", System.getenv("GITHUB_REF")?.replace("refs/heads/", "") ?: "N/A")
43+
value("Build Commit", System.getenv("GITHUB_SHA") ?: "N/A")
44+
45+
val ciLink = System.getenv("GITHUB_ACTIONS")?.let { "https://github.com/${System.getenv("GITHUB_REPOSITORY")}/actions/runs/${System.getenv("GITHUB_RUN_ID")}" } ?: "N/A"
46+
// Add tags to the build scan
47+
tag("CI")
48+
tag(System.getProperty("os.name"))
49+
// Add links to related information
50+
if(ciLink != "N/A") {
51+
link("GitHub Action", ciLink)
52+
} else {
53+
tag("local dev build")
2654
}
27-
// "auto-accept" license agreements only when running under CI server.
28-
publishAlwaysIf(!System.getenv("CI").isNullOrEmpty())
2955
}
3056
}

0 commit comments

Comments
 (0)