Browse Source

Switch from gradle enterprise to develocity plugin (#11050)

Lauri Tulmin 11 months ago
parent
commit
72bfb02569
2 changed files with 12 additions and 16 deletions
  1. 1 1
      conventions/src/main/kotlin/otel.java-conventions.gradle.kts
  2. 11 15
      settings.gradle.kts

+ 1 - 1
conventions/src/main/kotlin/otel.java-conventions.gradle.kts

@@ -344,7 +344,7 @@ tasks.withType<Test>().configureEach {
   // This value is quite big because with lower values (3 mins) we were experiencing large number of false positives
   timeout.set(Duration.ofMinutes(15))
 
-  retry {
+  develocity.testRetry {
     // You can see tests that were retried by this mechanism in the collected test reports and build scans.
     if (System.getenv().containsKey("CI") || rootProject.hasProperty("retryTests")) {
       maxRetries.set(5)

+ 11 - 15
settings.gradle.kts

@@ -12,7 +12,7 @@ pluginManagement {
 }
 
 plugins {
-  id("com.gradle.enterprise") version "3.17"
+  id("com.gradle.develocity") version "3.17"
   id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0"
   id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
   // this can't live in pluginManagement currently due to
@@ -38,30 +38,26 @@ 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 = "https://gradle.com/help/legal-terms-of-use"
+      termsOfUseAgree = "yes"
+      uploadInBackground = !isCI
 
       capture {
-        isTaskInputFiles = true
+        fileFingerprints = true
       }
     }
   }
 } else {
-  gradleEnterprise {
+  develocity {
     server = gradleEnterpriseServer
     buildScan {
-      isUploadInBackground = !isCI
-
-      this as com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures
-      publishIfAuthenticated()
-      publishAlways()
+      uploadInBackground = !isCI
+      publishing.onlyIf { it.isAuthenticated }
 
       capture {
-        isTaskInputFiles = true
+        fileFingerprints = true
       }
 
       gradle.startParameter.projectProperties["testJavaVersion"]?.let { tag(it) }
@@ -73,7 +69,7 @@ if (useScansGradleCom) {
   }
 
   buildCache {
-    remote(gradleEnterprise.buildCache) {
+    remote(develocity.buildCache) {
       isPush = isCI && geAccessKey.isNotEmpty()
     }
   }