From 1c64445cf6f4cfbc8d07cc17463673aa718b7804 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:31:46 -0500 Subject: [PATCH] Move away from deprecated gradle enterprise APIs (#6363) --- .github/repository-settings.md | 2 +- settings.gradle.kts | 29 ++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/repository-settings.md b/.github/repository-settings.md index e066f5fc18b..7e777d110b6 100644 --- a/.github/repository-settings.md +++ b/.github/repository-settings.md @@ -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=`, see [docs](https://docs.gradle.com/enterprise/gradle-plugin/#via_environment_variable) diff --git a/settings.gradle.kts b/settings.gradle.kts index 57236ebc854..e8368cb4e4d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -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" @@ -10,7 +10,7 @@ pluginManagement { } plugins { - id("com.gradle.enterprise") + id("com.gradle.develocity") } dependencyResolutionManagement { @@ -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) }