Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,4 @@ replay_pid*
.telemetry*
.lycheecache

!java-agent/benchmark/releases/*.jar

build-scan.txt
33 changes: 13 additions & 20 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,24 @@ val develocityServer = "https://develocity.opentelemetry.io"
val isCI = System.getenv("CI") != null
val develocityAccessKey = System.getenv("DEVELOCITY_ACCESS_KEY") ?: ""

// if develocity access key is not given and we are in CI, then we publish to scans.gradle.com
val useScansGradleCom = isCI && develocityAccessKey.isEmpty()

develocity {
if (useScansGradleCom) {
buildScan {
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseAgree = "yes"
}
} else {
if (develocityAccessKey.isNotEmpty()) {
server = develocityServer
buildScan {
publishing.onlyIf { it.isAuthenticated }
}

buildScan {
if (develocityAccessKey.isNotEmpty()) {
gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) }
gradle.startParameter.projectProperties["testJavaVM"]?.let { tag(it) }
gradle.startParameter.projectProperties["smokeTestSuite"]?.let {
value("Smoke test suite", it)
}
} else if (isCI) {
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseAgree = "yes"
} else {
publishing.onlyIf { false }
}
}

buildScan {
uploadInBackground = !isCI
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested and uploadInBackground didn't make a noticeable difference locally so removed


capture {
fileFingerprints = true
Expand All @@ -93,11 +87,10 @@ develocity {
}
}

if (!useScansGradleCom) {
buildCache {
remote(develocity.buildCache) {
isPush = isCI && develocityAccessKey.isNotEmpty()
}
buildCache {
remote(HttpBuildCache::class) {
url = uri("$develocityServer/cache/")
isPush = isCI && develocityAccessKey.isNotEmpty()
Comment on lines +90 to +93
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the magic to get it to use our develocity server just for the (read-only) build cache 🤞

}
}

Expand Down
Loading