Skip to content

Commit

Permalink
Move away from deprecated gradle enterprise APIs (#6363)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-berg committed Apr 11, 2024
1 parent 7acc4e2 commit 1c64445
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/repository-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Same settings as above for `main`, except:

* `GPG_PASSWORD` - stored in OpenTelemetry-Java 1Password
* `GPG_PRIVATE_KEY` - stored in OpenTelemetry-Java 1Password
* `GRADLE_ENTERPRISE_ACCESS_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
* `DEVELOCITY_ACCESS_KEY` - owned by [@jack-berg](https://github.com/jack-berg)
* Generated at https://ge.opentelemetry.io > My settings > Access keys
* format of env var is `ge.opentelemetry.io=<access key>`,
see [docs](https://docs.gradle.com/enterprise/gradle-plugin/#via_environment_variable)
Expand Down
29 changes: 14 additions & 15 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pluginManagement {
plugins {
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradle.enterprise") version "3.17"
id("com.gradle.develocity") version "3.17"
id("de.undercouch.download") version "5.6.0"
id("org.jsonschema2pojo") version "1.2.1"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
Expand All @@ -10,7 +10,7 @@ pluginManagement {
}

plugins {
id("com.gradle.enterprise")
id("com.gradle.develocity")
}

dependencyResolutionManagement {
Expand Down Expand Up @@ -71,30 +71,29 @@ val geAccessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") ?: ""
val useScansGradleCom = isCI && geAccessKey.isEmpty()

if (useScansGradleCom) {
gradleEnterprise {
develocity {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
isUploadInBackground = !isCI
publishAlways()
termsOfUseUrl.set("https://gradle.com/terms-of-service")
termsOfUseAgree.set("yes")
uploadInBackground.set(!isCI)
publishing.onlyIf { true }

capture {
isTaskInputFiles = true
fileFingerprints.set(true)
}
}
}
} else {
gradleEnterprise {
develocity {
server = gradleEnterpriseServer
buildScan {
isUploadInBackground = !isCI

this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
publishAlways()
uploadInBackground.set(!isCI)
publishing.onlyIf {
it.isAuthenticated
}

capture {
isTaskInputFiles = true
fileFingerprints.set(true)
}

gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) }
Expand Down

0 comments on commit 1c64445

Please sign in to comment.