From 518b14b19696d3f8e2efd38b130c5adf132c8d18 Mon Sep 17 00:00:00 2001 From: daz Date: Wed, 3 Apr 2024 15:09:53 -0600 Subject: [PATCH] Switch from com.gradle.enterprise to com.gradle.develocity --- .github/workflow-samples/groovy-dsl/settings.gradle | 9 ++++----- .../workflow-samples/kotlin-dsl/settings.gradle.kts | 11 +++++------ .../workflow-samples/no-wrapper-gradle-5/build.gradle | 9 ++++----- .github/workflow-samples/no-wrapper/settings.gradle | 9 ++++----- .../non-executable-wrapper/settings.gradle | 9 ++++----- .github/workflows/integ-test-caching-config.yml | 6 +++--- setup-gradle/README.md | 6 +++--- sources/src/job-summary.ts | 2 +- .../gradle-actions.build-result-capture.init.gradle | 2 +- sources/test/init-scripts/settings.gradle | 9 ++++----- .../gradlebuildaction/TestBuildResultRecorder.groovy | 9 +++------ .../gradlebuildaction/TestDevelocityInjection.groovy | 10 +++++----- 12 files changed, 41 insertions(+), 50 deletions(-) diff --git a/.github/workflow-samples/groovy-dsl/settings.gradle b/.github/workflow-samples/groovy-dsl/settings.gradle index 6b0c4be5..76353593 100644 --- a/.github/workflow-samples/groovy-dsl/settings.gradle +++ b/.github/workflow-samples/groovy-dsl/settings.gradle @@ -1,13 +1,12 @@ 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 "1.13" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" uploadInBackground = false } } diff --git a/.github/workflow-samples/kotlin-dsl/settings.gradle.kts b/.github/workflow-samples/kotlin-dsl/settings.gradle.kts index 0f8ff3be..cde6f386 100644 --- a/.github/workflow-samples/kotlin-dsl/settings.gradle.kts +++ b/.github/workflow-samples/kotlin-dsl/settings.gradle.kts @@ -1,14 +1,13 @@ 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 "1.13" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() - isUploadInBackground = false + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" + uploadInBackground = false } } diff --git a/.github/workflow-samples/no-wrapper-gradle-5/build.gradle b/.github/workflow-samples/no-wrapper-gradle-5/build.gradle index 1c1c5ccf..45d57b28 100644 --- a/.github/workflow-samples/no-wrapper-gradle-5/build.gradle +++ b/.github/workflow-samples/no-wrapper-gradle-5/build.gradle @@ -1,12 +1,11 @@ plugins { - id "com.gradle.build-scan" version "3.17" + id "com.gradle.develocity" version "3.17" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" uploadInBackground = false } } diff --git a/.github/workflow-samples/no-wrapper/settings.gradle b/.github/workflow-samples/no-wrapper/settings.gradle index 95c1a4e0..c4255b76 100644 --- a/.github/workflow-samples/no-wrapper/settings.gradle +++ b/.github/workflow-samples/no-wrapper/settings.gradle @@ -1,12 +1,11 @@ plugins { - id "com.gradle.enterprise" version "3.17" + id "com.gradle.develocity" version "3.17" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" uploadInBackground = false } } diff --git a/.github/workflow-samples/non-executable-wrapper/settings.gradle b/.github/workflow-samples/non-executable-wrapper/settings.gradle index 95c1a4e0..c4255b76 100644 --- a/.github/workflow-samples/non-executable-wrapper/settings.gradle +++ b/.github/workflow-samples/non-executable-wrapper/settings.gradle @@ -1,12 +1,11 @@ plugins { - id "com.gradle.enterprise" version "3.17" + id "com.gradle.develocity" version "3.17" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" uploadInBackground = false } } diff --git a/.github/workflows/integ-test-caching-config.yml b/.github/workflows/integ-test-caching-config.yml index 4e88c9b1..723b4ba6 100644 --- a/.github/workflows/integ-test-caching-config.yml +++ b/.github/workflows/integ-test-caching-config.yml @@ -31,10 +31,10 @@ jobs: uses: ./setup-gradle with: cache-read-only: false # For testing, allow writing cache entries on non-default branches - # Add "enterprise" to main cache entry but omit "notifications" + # Add "application" to main cache entry but omit "notifications" gradle-home-cache-includes: | caches - enterprise + application # Exclude build-cache from main cache entry gradle-home-cache-excludes: | caches/build-cache-* @@ -61,7 +61,7 @@ jobs: # Use the same configuration as used in the seed build gradle-home-cache-includes: | caches - enterprise + application gradle-home-cache-excludes: | caches/build-cache-* caches/*/executionHistory diff --git a/setup-gradle/README.md b/setup-gradle/README.md index 88cc51ff..89e513f9 100644 --- a/setup-gradle/README.md +++ b/setup-gradle/README.md @@ -660,11 +660,11 @@ jobs: run: ./gradlew build ``` -This configuration will automatically apply `v3.17` of the [Develocity Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/), and publish build scans to https://develocity.your-server.com. +This configuration will automatically apply `v3.17` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com. This example assumes that the `develocity.your-server.com` server allows anonymous publishing of build scans. In the likely scenario that your Develocity server requires authentication, you will also need to configure an additional environment variable -with a valid [Develocity access key](https://docs.gradle.com/enterprise/gradle-plugin/#via_environment_variable). +with a valid [Develocity access key](https://docs.gradle.com/develocity/gradle-plugin/#via_environment_variable). ## Configuring Develocity injection @@ -677,7 +677,7 @@ The `init-script` supports several additional configuration parameters that you | DEVELOCITY_ALLOW_UNTRUSTED_SERVER | | allow communication with an untrusted server; set to _true_ if your Develocity instance is using a self-signed certificate | | DEVELOCITY_CAPTURE_FILE_FINGERPRINTS | | enables capturing the paths and content hashes of each individual input file | | DEVELOCITY_ENFORCE_URL | | enforce the configured Develocity URL over a URL configured in the project's build; set to _true_ to enforce publication of build scans to the configured Develocity URL | -| DEVELOCITY_PLUGIN_VERSION | :white_check_mark: | the version of the [Develocity Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/) to apply | +| DEVELOCITY_PLUGIN_VERSION | :white_check_mark: | the version of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/) to apply | | DEVELOCITY_CCUD_PLUGIN_VERSION | | the version of the [Common Custom User Data Gradle plugin](https://github.com/gradle/common-custom-user-data-gradle-plugin) to apply, if any | | GRADLE_PLUGIN_REPOSITORY_URL | | the URL of the repository to use when resolving the Develocity and CCUD plugins; the Gradle Plugin Portal is used by default | | GRADLE_PLUGIN_REPOSITORY_USERNAME | | the username for the repository URL to use when resolving the Develocity and CCUD plugins | diff --git a/sources/src/job-summary.ts b/sources/src/job-summary.ts index 6ea0f779..1277b6e7 100644 --- a/sources/src/job-summary.ts +++ b/sources/src/job-summary.ts @@ -113,7 +113,7 @@ function renderBuildScan(result: BuildResult): string { return renderBuildScanBadge( 'PUBLISH_FAILED', 'orange', - 'https://docs.gradle.com/enterprise/gradle-plugin/#troubleshooting' + 'https://docs.gradle.com/develocity/gradle-plugin/#troubleshooting' ) } if (result.buildScanUri) { diff --git a/sources/src/resources/init-scripts/gradle-actions.build-result-capture.init.gradle b/sources/src/resources/init-scripts/gradle-actions.build-result-capture.init.gradle index 389084ef..6505c846 100644 --- a/sources/src/resources/init-scripts/gradle-actions.build-result-capture.init.gradle +++ b/sources/src/resources/init-scripts/gradle-actions.build-result-capture.init.gradle @@ -62,7 +62,7 @@ def captureUsingBuildScanPublished(buildScanExtension, rootProject, invocationId if (githubOutput) { new File(githubOutput) << "build-scan-url=${buildScan.buildScanUri}\n" } else { - // Retained for compatibility with older GitHub Enterprise versions + // Retained for compatibility with older GHES versions println("::set-output name=build-scan-url::${buildScan.buildScanUri}") } } diff --git a/sources/test/init-scripts/settings.gradle b/sources/test/init-scripts/settings.gradle index 57ae484c..d1ea8fcc 100644 --- a/sources/test/init-scripts/settings.gradle +++ b/sources/test/init-scripts/settings.gradle @@ -1,13 +1,12 @@ 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 "1.13" } -gradleEnterprise { +develocity { buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - publishAlways() + termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use" + termsOfUseAgree = "yes" uploadInBackground = false } } diff --git a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy index 253d5a3f..0e217f01 100644 --- a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy +++ b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy @@ -171,15 +171,12 @@ class TestBuildResultRecorder extends BaseInitScriptTest { when: settingsFile.text = """ plugins { - id 'com.gradle.enterprise' version '3.17' apply(false) + id 'com.gradle.develocity' version '3.17' apply(false) } gradle.settingsEvaluated { - apply plugin: 'com.gradle.enterprise' - gradleEnterprise { + apply plugin: 'com.gradle.develocity' + develocity { server = '$mockScansServer.address' - buildScan { - publishAlways() - } } } """ + settingsFile.text diff --git a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy index 6d5cc659..eb62de2b 100644 --- a/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy +++ b/sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDevelocityInjection.groovy @@ -55,7 +55,7 @@ class TestDevelocityInjection extends BaseInitScriptTest { assumeTrue testGradleVersion.compatibleWithCurrentJvm given: - settingsFile.text = maybeAddGradleEnterprisePlugin(testGradleVersion.gradleVersion, '3.16.2') + settingsFile.text = maybeAddDevelocityPlugin(testGradleVersion.gradleVersion, '3.16.2') buildFile.text = maybeAddBuildScanPlugin(testGradleVersion.gradleVersion, '3.16.2') when: @@ -443,15 +443,15 @@ class TestDevelocityInjection extends BaseInitScriptTest { } } - private String maybeAddGradleEnterprisePlugin(GradleVersion gradleVersion, String gePluginVersion) { + private String maybeAddDevelocityPlugin(GradleVersion gradleVersion, String gePluginVersion) { if (gradleVersion < GradleVersion.version('6.0')) { '' // applied in build.gradle } else { """ plugins { - id 'com.gradle.enterprise' version '${gePluginVersion}' + id 'com.gradle.develocity' version '${gePluginVersion}' } - gradleEnterprise { + develocity { server = '${mockScansServer.address}' buildScan { publishAlways() @@ -475,7 +475,7 @@ class TestDevelocityInjection extends BaseInitScriptTest { } else if (gradleVersion < GradleVersion.version('6.0')) { """ plugins { - id 'com.gradle.build-scan' version '${buildScanPluginVersion}' + id 'com.gradle.develocity' version '${buildScanPluginVersion}' } buildScan { server = '${mockScansServer.address}'