From 1cc79b2d05a3f33c8d2cd98c648eaedd16f55970 Mon Sep 17 00:00:00 2001 From: Eric Haag <ehaag@gradle.com> Date: Thu, 24 Oct 2024 12:59:43 -0500 Subject: [PATCH 1/4] Replace ocurrences of Gradle Enterprise with Develocity --- Gradle.md | 12 +-- Maven.md | 12 +-- .../gradle/ConfigureDevelocityAdaptor.java | 2 +- components/scripts/README.md | 4 +- .../01-validate-incremental-building.sh | 2 +- ...idate-local-build-caching-same-location.sh | 2 +- ...local-build-caching-different-locations.sh | 2 +- .../04-validate-remote-build-caching-ci-ci.sh | 10 +-- ...-validate-remote-build-caching-ci-local.sh | 12 +-- .../configure-build-validation.gradle | 4 +- components/scripts/lib/config.sh | 2 +- components/scripts/lib/interactive-mode.sh | 87 +++++++++---------- ...idate-local-build-caching-same-location.sh | 6 +- ...local-build-caching-different-locations.sh | 12 +-- .../03-validate-remote-build-caching-ci-ci.sh | 18 ++-- ...-validate-remote-build-caching-ci-local.sh | 33 ++++--- components/scripts/network.settings | 6 +- settings.gradle.kts | 2 +- 18 files changed, 109 insertions(+), 119 deletions(-) diff --git a/Gradle.md b/Gradle.md index 965855e5..be51c99f 100644 --- a/Gradle.md +++ b/Gradle.md @@ -109,13 +109,13 @@ To get the most out of the experiments and also when building with Develocity du You can find a complete example of how to apply the Common Custom User Data Gradle plugin to your build [here](https://github.com/gradle/develocity-build-config-samples/tree/main/common-develocity-gradle-configuration-groovy/settings.gradle) for Groovy DSL and [here](https://github.com/gradle/develocity-build-config-samples/blob/main/common-develocity-gradle-configuration-kotlin/settings.gradle.kts) for Kotlin DSL. -## Authenticating with Gradle Enterprise +## Authenticating with Develocity -Some scripts fetch data from build scans that were published as part of running an experiment. The build scan data is fetched by leveraging the [Develocity API](https://docs.gradle.com/enterprise/api-manual/). It is not strictly necessary that you have permission to call these APIs to execute a script successfully, but the summary provided once the script has finished running its experiment will be more comprehensive if the build scan data is accessible. +Some scripts fetch data from build scans that were published as part of running an experiment. The build scan data is fetched by leveraging the [Develocity API](https://docs.gradle.com/develocity/api-manual/). It is not strictly necessary that you have permission to call these APIs to execute a script successfully, but the summary provided once the script has finished running its experiment will be more comprehensive if the build scan data is accessible. -You can check your granted permissions by navigating in the browser to the 'My Settings' section from the user menu of your Develocity UI. You need the 'Access build data via the API' permission. Additionally, the script needs an access key to authenticate with the APIs. See [Authenticating with Develocity](https://docs.gradle.com/enterprise/gradle-plugin/#authenticating) for details on how to create an access key and storing it locally. +You can check your granted permissions by navigating in the browser to the 'My Settings' section from the user menu of your Develocity UI. You need the 'Access build data via the API' permission. Additionally, the script needs an access key to authenticate with the APIs. See [Authenticating with Develocity](https://docs.gradle.com/develocity/gradle-plugin/current/#authenticating) for details on how to create an access key and storing it locally. -By default, the scripts fetching build scan data try to find the access key in the `enterprise/keys.properties` file within the Gradle user home directory (`~/.gradle` by default). Alternatively, the access key can be specified via the `GRADLE_ENTERPRISE_ACCESS_KEY` environment variable. You can also authenticate with the APIs using username and password instead by setting the `GRADLE_ENTERPRISE_USERNAME` and `GRADLE_ENTERPRISE_PASSWORD` environment variables. +By default, the scripts fetching build scan data try to find the access key in the `develocity/keys.properties` file within the Gradle user home directory (`~/.gradle` by default). Alternatively, the access key can be specified via the `DEVELOCITY_ACCESS_KEY` environment variable. You can also authenticate with the APIs using username and password instead by setting the `DEVELOCITY_USERNAME` and `DEVELOCITY_PASSWORD` environment variables. ## Configuring the network settings to connect to Develocity @@ -140,7 +140,7 @@ The scripts that fetch build scan data expect some of it to be present as custom ## Redirecting build scan publishing The scripts that run one or more builds locally can be configured to publish build scans to a different -Develocity server than the one that the builds point to by passing the `-s` or `--gradle-enterprise-server` +Develocity server than the one that the builds point to by passing the `-s` or `--develocity-server` command line argument. In the example below, the script will configure the local builds to publish their build scans to develocity.example.io regardless of what server is configured in the build. @@ -151,7 +151,7 @@ to develocity.example.io regardless of what server is configured in the build. ## Instrumenting the build with Develocity The scripts that run one or more builds locally can be configured to connect the builds to a given Develocity -server in case the builds are not already connected to Develocity by passing the `-e` or `--enable-gradle-enterprise` +server in case the builds are not already connected to Develocity by passing the `-e` or `--enable-develocity` command line argument. In the example below, the script will configure the non-instrumented builds to connect to the Develocity server at develocity.example.io. diff --git a/Maven.md b/Maven.md index ccb58ad2..714a1596 100644 --- a/Maven.md +++ b/Maven.md @@ -107,13 +107,13 @@ To get the most out of the experiments and also when building with Develocity du You can find a complete example of how to apply the Common Custom User Data Maven extension to your build [here](https://github.com/gradle/develocity-build-config-samples/blob/main/common-develocity-maven-configuration/.mvn/extensions.xml). -## Authenticating with Gradle Enterprise +## Authenticating with Develocity -Some scripts fetch data from build scans that were published as part of running an experiment. The build scan data is fetched by leveraging the [Develocity API](https://docs.gradle.com/enterprise/api-manual/). It is not strictly necessary that you have permission to call these APIs to execute a script successfully, but the summary provided once the script has finished running its experiment will be more comprehensive if the build scan data is accessible. +Some scripts fetch data from build scans that were published as part of running an experiment. The build scan data is fetched by leveraging the [Develocity API](https://docs.gradle.com/develocity/api-manual/). It is not strictly necessary that you have permission to call these APIs to execute a script successfully, but the summary provided once the script has finished running its experiment will be more comprehensive if the build scan data is accessible. -You can check your granted permissions by navigating in the browser to the 'My Settings' section from the user menu of your Develocity UI. You need the 'Access build data via the API' permission. Additionally, the script needs an access key to authenticate with the APIs. See [Authenticating with Develocity](https://docs.gradle.com/enterprise/maven-extension/#authenticating_with_gradle_enterprise) for details on how to create an access key and storing it locally. +You can check your granted permissions by navigating in the browser to the 'My Settings' section from the user menu of your Develocity UI. You need the 'Access build data via the API' permission. Additionally, the script needs an access key to authenticate with the APIs. See [Authenticating with Develocity](https://docs.gradle.com/develocity/maven-extension/current/#authenticating_with_develocity) for details on how to create an access key and storing it locally. -By default, the scripts fetching build scan data try to find the access key in the `enterprise/keys.properties` file within the Gradle user home directory (`~/.gradle` by default). Alternatively, the access key can be specified via the `GRADLE_ENTERPRISE_ACCESS_KEY` environment variable. You can also authenticate with the APIs using username and password instead by setting the `GRADLE_ENTERPRISE_USERNAME` and `GRADLE_ENTERPRISE_PASSWORD` environment variables. +By default, the scripts fetching build scan data try to find the access key in the `.m2/.develocity/keys.properties` file within the user's home directory. Alternatively, the access key can be specified via the `DEVELOCITY_ACCESS_KEY` environment variable. You can also authenticate with the APIs using username and password instead by setting the `DEVELOCITY_USERNAME` and `DEVELOCITY_PASSWORD` environment variables. ## Configuring the network settings to connect to Develocity @@ -138,7 +138,7 @@ The scripts that fetch build scan data expect some of it to be present as custom ## Redirecting build scan publishing The scripts that run one or more builds locally can be configured to publish build scans to a different -Develocity server than the one that the builds point to by passing the `-s` or `--gradle-enterprise-server` +Develocity server than the one that the builds point to by passing the `-s` or `--develocity-server` command line argument. In the example below, the script will configure the local builds to publish their build scans to develocity.example.io regardless of what server is configured in the build. @@ -149,7 +149,7 @@ to develocity.example.io regardless of what server is configured in the build. ## Instrumenting the build with Develocity The scripts that run one or more builds locally can be configured to connect the builds to a given Develocity -server in case the builds are not already connected to Develocity by passing the `-e` or `--enable-gradle-enterprise` +server in case the builds are not already connected to Develocity by passing the `-e` or `--enable-develocity` command line argument. In the example below, the script will configure the non-instrumented builds to connect to the Develocity server at develocity.example.io. diff --git a/components/configure-gradle-enterprise-maven-extension/src/main/java/com/gradle/ConfigureDevelocityAdaptor.java b/components/configure-gradle-enterprise-maven-extension/src/main/java/com/gradle/ConfigureDevelocityAdaptor.java index 6cf588a1..d22885f9 100644 --- a/components/configure-gradle-enterprise-maven-extension/src/main/java/com/gradle/ConfigureDevelocityAdaptor.java +++ b/components/configure-gradle-enterprise-maven-extension/src/main/java/com/gradle/ConfigureDevelocityAdaptor.java @@ -58,7 +58,7 @@ private static void registerBuildScanActions(BuildScanApiAdapter buildScan, Stri if (buildScan.getServer() == null && !omitServerUrlValidation) { buildScan.publishAlwaysIf(false); // disable publishing, otherwise scans.gradle.com will be used File errorFile = new File(EXPERIMENT_DIR, "errors.txt"); - append(errorFile, "The Gradle Enterprise server URL has not been configured in the project or on the command line."); + append(errorFile, "The Develocity server URL has not been configured in the project or on the command line."); } }); diff --git a/components/scripts/README.md b/components/scripts/README.md index 9c29db96..cd2750da 100644 --- a/components/scripts/README.md +++ b/components/scripts/README.md @@ -1,8 +1,8 @@ -Gradle Enterprise Build Validation Scripts +Develocity Build Validation Scripts ========================================== Details and instructions on how to use the build validation scripts can be found here: https://github.com/gradle/gradle-enterprise-build-validation-scripts -The Gradle Enterprise Build Validation scripts are open-source software released under the Apache 2.0 License: +The Develocity Build Validation scripts are open-source software released under the Apache 2.0 License: https://www.apache.org/licenses/LICENSE-2.0.html diff --git a/components/scripts/gradle/01-validate-incremental-building.sh b/components/scripts/gradle/01-validate-incremental-building.sh index 0f8b2558..f2a67074 100755 --- a/components/scripts/gradle/01-validate-incremental-building.sh +++ b/components/scripts/gradle/01-validate-incremental-building.sh @@ -263,7 +263,7 @@ $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} Now that the second build has finished successfully, you are ready to measure -in Gradle Enterprise how well your build leverages Gradle’s incremental build +in Develocity how well your build leverages Gradle’s incremental build functionality for the invoked set of Gradle tasks. Some of the build scan data will be fetched from the build scans produced by diff --git a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh index ea6b1479..ee44a40d 100755 --- a/components/scripts/gradle/02-validate-local-build-caching-same-location.sh +++ b/components/scripts/gradle/02-validate-local-build-caching-same-location.sh @@ -241,7 +241,7 @@ $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} Now that the second build has finished successfully, you are ready to measure in -Gradle Enterprise how well your build leverages Gradle’s local build caching +Develocity how well your build leverages Gradle’s local build caching functionality for the invoked set of Gradle tasks. Some of the build scan data will be fetched from the build scans produced by the diff --git a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh index 6606af15..e5d08879 100755 --- a/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh +++ b/components/scripts/gradle/03-validate-local-build-caching-different-locations.sh @@ -278,7 +278,7 @@ $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} Now that the second build has finished successfully, you are ready to measure in -Gradle Enterprise how well your build leverages Gradle’s local build caching +Develocity how well your build leverages Gradle’s local build caching functionality for the invoked set of Gradle tasks. Some of the build scan data will be fetched from the build scans produced by the diff --git a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh index e729f9a0..96a1dc6f 100755 --- a/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/gradle/04-validate-remote-build-caching-ci-ci.sh @@ -242,8 +242,8 @@ Now that the second build has finished successfully, some of the build scan data will be fetched from the two provided build scans to assist you in your investigation. -The build scan data will be fetched via the Gradle Enterprise API, as explained -earlier in the preparations section of this experiment. +The build scan data will be fetched via the Develocity API, as explained earlier +in the preparations section of this experiment. Some of the fetched build scan data is expected to be present as custom values. By default, this experiment assumes that these custom values have been created @@ -262,9 +262,9 @@ explain_measure_build_results() { $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} -At this point, you are ready to measure in Gradle Enterprise how well your -build leverages Gradle’s remote build cache for the set of Gradle tasks invoked -from two different CI agents. +At this point, you are ready to measure in Develocity how well your build +leverages Gradle’s remote build cache for the set of Gradle tasks invoked from +two different CI agents. ${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE} EOF diff --git a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh index 9d021932..b56d075e 100755 --- a/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/gradle/05-validate-remote-build-caching-ci-local.sh @@ -149,7 +149,7 @@ validate_required_args() { fi if [[ "${enable_ge}" == "on" && -z "${ge_server}" ]]; then - _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Gradle Enterprise on a project not already connected: --gradle-enterprise-server" "${INVALID_INPUT}" + _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Develocity on a project not already connected: --develocity-server" "${INVALID_INPUT}" fi } @@ -309,8 +309,8 @@ Now that the build on CI has finished successfully, some of the build scan data will be fetched from the provided build scan to assist you in your investigation. -The build scan data will be fetched via the Gradle Enterprise API, as explained -earlier in the preparations section of this experiment. +The build scan data will be fetched via the Develocity API, as explained earlier +in the preparations section of this experiment. Some of the fetched build scan data is expected to be present as custom values. By default, this experiment assumes that these custom values have been created @@ -415,9 +415,9 @@ explain_measure_build_results() { $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} -At this point, you are ready to measure in Gradle Enterprise how well your -build leverages Gradle’s remote build cache for the set of Gradle tasks invoked -from a CI agent and then on a local machine. +At this point, you are ready to measure in Develocity how well your build +leverages Gradle’s remote build cache for the set of Gradle tasks invoked from a +CI agent and then on a local machine. Some of the build scan data will be fetched from the build scans produced by the two builds to assist you in your investigation. diff --git a/components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle b/components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle index edfd97d8..42f7d849 100644 --- a/components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle +++ b/components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle @@ -70,7 +70,7 @@ def failMissingDevelocityServerURL = { def docs -> errorFile.text = 'The Develocity server URL has not been configured in the project or on the command line.' throw new IllegalStateException("The Develocity server URL is not configured.\n" + "Either configure it directly (see $docs) in the project,\n" - + "or use --gradle-enterprise-server when running the build validation script.") + + "or use --develocity-server when running the build validation script.") } // fail if a plugin is not applied @@ -79,7 +79,7 @@ def failMissingPlugin = { def plugin, docs -> errorFile.text = "The $plugin plugin is missing from the project." throw new IllegalStateException("The $plugin plugin is missing from the project.\n" + "Either apply it directly (see $docs),\n" + - "or use --enable-gradle-enterprise when running the build validation script.") + "or use --enable-develocity when running the build validation script.") } // do not fail if the CCUD plugin is not applied but surface a warning diff --git a/components/scripts/lib/config.sh b/components/scripts/lib/config.sh index 0d144e28..55998c01 100644 --- a/components/scripts/lib/config.sh +++ b/components/scripts/lib/config.sh @@ -97,7 +97,7 @@ validate_required_args() { fi if [[ "${enable_ge}" == "on" && -z "${ge_server}" ]]; then - _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Gradle Enterprise on a project not already connected: --gradle-enterprise-server" "${INVALID_INPUT}" + _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Develocity on a project not already connected: --develocity-server" "${INVALID_INPUT}" fi } diff --git a/components/scripts/lib/interactive-mode.sh b/components/scripts/lib/interactive-mode.sh index ed911978..58fa2ed6 100644 --- a/components/scripts/lib/interactive-mode.sh +++ b/components/scripts/lib/interactive-mode.sh @@ -21,7 +21,7 @@ print_separator() { print_introduction_title() { cat <<EOF -${HEADER_COLOR}Gradle Enterprise - Build Validation +${HEADER_COLOR}Develocity - Build Validation Experiment ${EXP_NO}: ${EXP_DESCRIPTION}${RESTORE} EOF @@ -40,10 +40,10 @@ explain_prerequisites_ccud_gradle_plugin() { $(print_separator) ${HEADER_COLOR}Preparation ${preparation_step}- Configure build with Common Custom User Data Gradle plugin${RESTORE} -To get the most out of this experiment and also when building with Gradle -Enterprise during daily development, it is advisable that you apply the Common -Custom User Data Gradle plugin to your build. Details on how to apply the -plugin are available from the documentation of the build validation scripts. +To get the most out of this experiment and also when building with Develocity +during daily development, it is advisable that you apply the Common Custom User +Data Gradle plugin to your build. Details on how to apply the plugin are +available from the documentation of the build validation scripts. https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Gradle.md#applying-the-common-custom-user-data-gradle-plugin @@ -68,10 +68,10 @@ explain_prerequisites_ccud_maven_extension() { $(print_separator) ${HEADER_COLOR}Preparation ${preparation_step}- Configure build with Common Custom User Data Maven extension${RESTORE} -To get the most out of this experiment and also when building with Gradle -Enterprise during daily development, it is advisable that you apply the Common -Custom User Data Maven extension to your build. Details on how to apply the -extension are available from the documentation of the build validation scripts. +To get the most out of this experiment and also when building with Develocity +during daily development, it is advisable that you apply the Common Custom User +Data Maven extension to your build. Details on how to apply the extension are +available from the documentation of the build validation scripts. https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Maven.md#applying-the-common-custom-user-data-maven-extension @@ -102,19 +102,14 @@ typical build configuration is described below. gradle.properties: org.gradle.caching=true -settings.gradle: +settings.gradle(.kts): buildCache { local { enabled = false } // must be false for this experiment - remote(HttpBuildCache) { - url = 'https://ge.example.com/cache/exp4/' // adjust to your GE hostname, and note the trailing slash - allowUntrustedServer = true // set to false if a trusted certificate is configured for the GE server - credentials { creds -> - // inject credentials with read-write access to the remote build cache via env vars set in your CI environment - creds.username = System.getenv('GRADLE_ENTERPRISE_CACHE_USERNAME') - creds.password = System.getenv('GRADLE_ENTERPRISE_CACHE_PASSWORD') - } + remote(develocity.buildCache) { enabled = true // must be true for this experiment - push = System.getenv('BUILD_URL') != null // adjust to an env var that is always present only in your CI environment + allowUntrustedServer = true // set to false if a trusted certificate is configured for the Develocity server + path = "cache/exp4-2021-dec31-take1" // update 'exp4-2021-dec31-take1' for each new run of the experiment + push = System.getenv("CI") != null // adjust to an env var that is always present only in your CI environment }} Your updated build configuration needs to be pushed to a separate branch that @@ -142,26 +137,22 @@ ${HEADER_COLOR}Preparation ${preparation_step}- Configure build for remote build You must first configure your build for remote build caching. An extract of a typical build configuration is described below. -.mvn/gradle-enterprise.xml: -<gradleEnterprise> +.mvn/develocity.xml: +<develocity> <buildCache> <local> - <enabled>false</enabled> <!-- must be false for this experiment --> + <enabled>false</enabled> <!-- must be false for this experiment --> </local> <remote> <server> - <url>https://ge.example.com/cache/exp3/</url> <!-- adjust to your GE hostname, and note the trailing slash --> - <allowUntrusted>true</allowUntrusted> <!-- set to false if a trusted certificate is configured for the GE server --> - <credentials> - <username>\${env.GRADLE_ENTERPRISE_CACHE_USERNAME}</username> - <password>\${env.GRADLE_ENTERPRISE_CACHE_PASSWORD}</password> - </credentials> + <url>https://develocity.example.com/cache/exp3-2021-dec31-take1/</url> <!-- adjust to your Develocity hostname, and note the trailing slash --> + <allowUntrusted>true</allowUntrusted> <!-- set to false if a trusted certificate is configured for the Develocity server --> </server> - <enabled>true</enabled> <!-- must be true for this experiment --> - <storeEnabled>#{env['BUILD_URL'] != null}</storeEnabled> <!-- adjust to an env var that is always present only in your CI environment --> + <enabled>true</enabled> <!-- must be true for this experiment --> + <storeEnabled>#{isTrue(env['CI'])}</storeEnabled> <!-- adjust to an env var that is always present only in your CI environment --> </remote> </buildCache> -</gradleEnterprise> +</develocity> Your updated build configuration needs to be pushed to a separate branch that is only used for running the experiments. @@ -186,10 +177,10 @@ explain_prerequisites_empty_remote_build_cache() { If you choose option b) and do not want to interfere with an already existing build caching configuration in your build, you can override the local and remote build cache configuration via system properties right when triggering -the build on CI. Details on how to provide the overrides are available from -the documentation of the the Gradle Enterprise Maven extension. +the build on CI. Details on how to provide the overrides are available from the +documentation of the the Develocity Maven extension. -https://docs.gradle.com/enterprise/maven-extension/#configuring_the_remote_cache +https://docs.gradle.com/develocity/maven-extension/current/#configuring_the_remote_cache EOF else IFS='' read -r -d '' build_tool_instructions <<EOF @@ -218,13 +209,13 @@ a) If none of your builds are yet writing to the remote build cache besides the builds of this experiment, purge the remote build cache that your build is configured to connect to. You can purge the remote build cache by navigating in the browser to the 'Build Cache' admin section from the user menu of your -Gradle Enterprise UI, selecting the build cache node the build is pointing to, -and then clicking the 'Purge cache' button. +Develocity UI, selecting the build cache node the build is pointing to, and then +clicking the 'Purge cache' button. b) If you are not in a position to purge the remote build cache, you can connect to a unique shard of the remote build cache each time you run this experiment. A shard is accessed via an identifier that is appended to the path of the remote -build cache URL, for example https://ge.example.com/cache/exp4-2021-dec31-take1/ +build cache URL, for example https://develocity.example.com/cache/exp4-2021-dec31-take1/ which encodes the experiment type, the current date, and a counter that needs to be increased every time the experiment is rerun. Using such an encoding schema ensures that for each run of the experiment an empty remote build cache @@ -248,22 +239,22 @@ explain_prerequisites_api_access() { fi if [[ "${BUILD_TOOL}" == "Maven" ]]; then - documentation_link="https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Maven.md#authenticating-with-gradle-enterprise" + documentation_link="https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Maven.md#authenticating-with-develocity" else - documentation_link="https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Gradle.md#authenticating-with-gradle-enterprise" + documentation_link="https://github.com/gradle/gradle-enterprise-build-validation-scripts/blob/main/Gradle.md#authenticating-with-develocity" fi IFS='' read -r -d '' text <<EOF $(print_separator) -${HEADER_COLOR}Preparation ${preparation_step}- Ensure Gradle Enterprise API access${RESTORE} - -Some build scan data will be fetched from the invoked builds via the Gradle -Enterprise API. It is not strictly necessary that you have permission to -call the Gradle Enterprise API while doing this experiment, but the summary -provided at the end of the experiment will be more comprehensive if the build -scan data is accessible. Details on how to check your access permissions and -how to provide the necessary API credentials when running the experiment are -available from the documentation of the build validation scripts. +${HEADER_COLOR}Preparation ${preparation_step}- Ensure Develocity API access${RESTORE} + +Some build scan data will be fetched from the invoked builds via the Develocity +API. It is not strictly necessary that you have permission to call the +Develocity API while doing this experiment, but the summary provided at the end +of the experiment will be more comprehensive if the build scan data is +accessible. Details on how to check your access permissions and how to provide +the necessary API credentials when running the experiment are available from the +documentation of the build validation scripts. ${documentation_link} diff --git a/components/scripts/maven/01-validate-local-build-caching-same-location.sh b/components/scripts/maven/01-validate-local-build-caching-same-location.sh index 17f16601..e9ca2269 100755 --- a/components/scripts/maven/01-validate-local-build-caching-same-location.sh +++ b/components/scripts/maven/01-validate-local-build-caching-same-location.sh @@ -159,7 +159,7 @@ print_introduction() { $(print_introduction_title) In this experiment, you will validate how well a given project leverages -Gradle Enterprise’s local build caching functionality when running the build in +Develocity’s local build caching functionality when running the build in the same location. A build is considered fully cacheable if it can be invoked twice in a row with build caching enabled and, during the second invocation, all cacheable goals avoid performing any work because: @@ -246,8 +246,8 @@ $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} Now that the second build has finished successfully, you are ready to measure in -Gradle Enterprise how well your build leverages Gradle Enterprise's local build -caching functionality for the invoked set of Maven goals. +Develocity how well your build leverages Develocity's local build caching +functionality for the invoked set of Maven goals. Some of the build scan data will be fetched from the build scans produced by the two builds to assist you in your investigation. diff --git a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh index 44f0b4ff..7e13e053 100755 --- a/components/scripts/maven/02-validate-local-build-caching-different-locations.sh +++ b/components/scripts/maven/02-validate-local-build-caching-different-locations.sh @@ -163,10 +163,10 @@ print_introduction() { $(print_introduction_title) In this experiment, you will validate how well a given project leverages -Gradle Enterprise's local build caching functionality when running the build -from different locations. A build is considered fully cacheable if it can be -invoked twice in a row with build caching enabled and, during the second -invocation, all cacheable goals avoid performing any work because: +Develocity's local build caching functionality when running the build from +different locations. A build is considered fully cacheable if it can be invoked +twice in a row with build caching enabled and, during the second invocation, all +cacheable goals avoid performing any work because: * The cacheable goals’ inputs have not changed since their last invocation and * The cacheable goals’ outputs are present in the local build cache and @@ -282,8 +282,8 @@ $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} Now that the second build has finished successfully, you are ready to measure in -Gradle Enterprise how well your build leverages Gradle Enterprise's local build -caching functionality for the invoked set of Maven goals. +Develocity how well your build leverages Develocity's local build caching +functionality for the invoked set of Maven goals. Some of the build scan data will be fetched from the build scans produced by the two builds to assist you in your investigation. diff --git a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh index cd5e823f..a3e5ff0b 100755 --- a/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh +++ b/components/scripts/maven/03-validate-remote-build-caching-ci-ci.sh @@ -129,10 +129,10 @@ print_introduction() { $(print_introduction_title) In this experiment, you will validate how well a given project leverages -Gradle Enterprise's remote build caching functionality when running the build -from two different CI agents. A build is considered fully cacheable if it can -be invoked twice in a row with build caching enabled and, during the second -invocation, all cacheable goals avoid performing any work because: +Develocity's remote build caching functionality when running the build from two +different CI agents. A build is considered fully cacheable if it can be invoked +twice in a row with build caching enabled and, during the second invocation, all +cacheable goals avoid performing any work because: * The goals' inputs have not changed since their last invocation and * The goals' outputs are present in the remote build cache and @@ -240,8 +240,8 @@ Now that the second build has finished successfully, some of the build scan data will be fetched from the two provided build scans to assist you in your investigation. -The build scan data will be fetched via the Gradle Enterprise API, as explained -earlier in the preparations section of this experiment. +The build scan data will be fetched via the Develocity API, as explained earlier +in the preparations section of this experiment. Some of the fetched build scan data is expected to be present as custom values. By default, this experiment assumes that these custom values have been created @@ -260,9 +260,9 @@ explain_measure_build_results() { $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} -At this point, you are ready to measure in Gradle Enterprise how well your -build leverages Gradle’s remote build cache for the set of Gradle goals invoked -from two different CI agents. +At this point, you are ready to measure in Develocity how well your build +leverages Gradle’s remote build cache for the set of Gradle goals invoked from +two different CI agents. ${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE} EOF diff --git a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh index a7ed92c8..e3ddecff 100755 --- a/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh +++ b/components/scripts/maven/04-validate-remote-build-caching-ci-local.sh @@ -147,7 +147,7 @@ validate_required_args() { fi if [[ "${enable_ge}" == "on" && -z "${ge_server}" ]]; then - _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Gradle Enterprise on a project not already connected: --gradle-enterprise-server" "${INVALID_INPUT}" + _PRINT_HELP=yes die "ERROR: Missing required argument when enabling Develocity on a project not already connected: --develocity-server" "${INVALID_INPUT}" fi } @@ -227,11 +227,10 @@ print_introduction() { $(print_introduction_title) In this experiment, you will validate how well a given project leverages -Gradle Enterprise's remote build caching functionality when running the build -from a CI agent and then on a local machine. A build is considered fully -cacheable if it can be invoked twice in a row with build caching enabled and, -during the second invocation, all cacheable goals avoid performing any work -because: +Develocity's remote build caching functionality when running the build from a CI +agent and then on a local machine. A build is considered fully cacheable if it +can be invoked twice in a row with build caching enabled and, during the second +invocation, all cacheable goals avoid performing any work because: * The cacheable goals' inputs have not changed since their last invocation and * The cacheable goals' outputs are present in the remote build cache and @@ -317,15 +316,15 @@ Now that the build on CI has finished successfully, some of the build scan data will be fetched from the provided build scan to assist you in your investigation. -The build scan data will be fetched via the Gradle Enterprise Export API. It is -not strictly necessary that you have permission to call the Export API while -doing this experiment, but the summary provided at the end of the experiment -will be more comprehensive if the build scan data is accessible. You can check -your granted permissions by navigating in the browser to the 'My Settings' -section from the user menu of your Gradle Enterprise UI. Your Gradle Enterprise -access key must be specified in the ~/.m2/.gradle-enterprise/keys.properties file. +The build scan data will be fetched via the Develocity API. It is not strictly +necessary that you have permission to call the API while doing this experiment, +but the summary provided at the end of the experiment will be more comprehensive +if the build scan data is accessible. You can check your granted permissions by +navigating in the browser to the 'My Settings' section from the user menu of +your Develocity UI. Your Develocity access key must be specified in the +~/.m2/.develocity/keys.properties file. -https://docs.gradle.com/enterprise/gradle-plugin/#via_file +https://docs.gradle.com/develocity/maven-extension/current/#via_file Some of the fetched build scan data is expected to be present as custom values. By default, this experiment assumes that these custom values have been created @@ -430,9 +429,9 @@ explain_measure_build_results() { $(print_separator) ${HEADER_COLOR}Measure build results${RESTORE} -At this point, you are ready to measure in Gradle Enterprise how well your -build leverages Gradle Enterprise's remote build cache for the set of Gradle -goals invoked from a CI agent and then on a local machine. +At this point, you are ready to measure in Develocity how well your build +leverages Develocity's remote build cache for the set of Gradle goals invoked +from a CI agent and then on a local machine. Some of the build scan data will be fetched from the build scans produced by the two builds to assist you in your investigation. diff --git a/components/scripts/network.settings b/components/scripts/network.settings index 4f23ca76..c034fd4d 100644 --- a/components/scripts/network.settings +++ b/components/scripts/network.settings @@ -1,4 +1,4 @@ -# Uncomment and update to use a HTTP(S) proxy when connecting to the Gradle Enterprise server +# Uncomment and update to use a HTTP(S) proxy when connecting to the Develocity server #http.proxyHost=proxy.host.com #http.proxyPort=8888 #http.nonProxyHosts=localhost|127.*|[::1] @@ -10,12 +10,12 @@ #https.proxyUser=user #https.proxyPassword=password -# Uncomment and update to use a custom trust store when connecting to the Gradle Enterprise server +# Uncomment and update to use a custom trust store when connecting to the Develocity server #javax.net.ssl.trustStore=myTrustStore.jks #javax.net.ssl.trustStorePassword=changeit #javax.net.ssl.trustStoreType=jks -# Uncomment to disable SSL certificate validation when connecting to the Gradle Enterprise server +# Uncomment to disable SSL certificate validation when connecting to the Develocity server #ssl.allowUntrustedServer=true # Uncomment to use a custom connect or read timeout when fetching Build Scan data diff --git a/settings.gradle.kts b/settings.gradle.kts index 44e49b90..a7a11fe1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,7 +19,7 @@ buildCache { remote(develocity.buildCache) { isEnabled = true // Check access key presence to avoid build cache errors on PR builds when access key is not present - val accessKey = System.getenv("GRADLE_ENTERPRISE_ACCESS_KEY") + val accessKey = System.getenv("DEVELOCITY_ACCESS_KEY") isPush = isCI && !accessKey.isNullOrEmpty() } } From 7604767177781567344a30883ccf7757f11919f1 Mon Sep 17 00:00:00 2001 From: Eric Haag <ehaag@gradle.com> Date: Thu, 24 Oct 2024 15:45:42 -0500 Subject: [PATCH 2/4] Update GitHub Actions workflows with Develocity branded parameters --- .github/actions/gradle/experiment-1/action.yml | 14 ++++++++++++++ .github/actions/gradle/experiment-2/action.yml | 14 ++++++++++++++ .github/actions/gradle/experiment-3/action.yml | 14 ++++++++++++++ .github/actions/maven/experiment-1/action.yml | 14 ++++++++++++++ .github/actions/maven/experiment-2/action.yml | 14 ++++++++++++++ 5 files changed, 70 insertions(+) diff --git a/.github/actions/gradle/experiment-1/action.yml b/.github/actions/gradle/experiment-1/action.yml index dcaa7c2d..aa589132 100644 --- a/.github/actions/gradle/experiment-1/action.yml +++ b/.github/actions/gradle/experiment-1/action.yml @@ -23,10 +23,18 @@ inputs: args: description: "Additional arguments to pass to Gradle" required: false + develocityUrl: + description: "The URL for the Develocity server to connect to" + required: false gradleEnterpriseUrl: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'develocityUrl' instead." description: "The URL for the Gradle Enterprise server to connect to" required: false + enableDevelocity: + description: "Enables Develocity on a project not already connected" + required: false enableGradleEnterprise: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'enableDevelocity' instead." description: "Enables Gradle Enterprise on a project not already connected" required: false outputs: @@ -76,10 +84,16 @@ runs: if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then ARG_GE_URL="${{ inputs.gradleEnterpriseUrl }}" fi + if [ ! -z "${{ inputs.develocityUrl }}" ]; then + ARG_GE_URL="${{ inputs.develocityUrl }}" + fi ARG_GE_ENABLE="" if [ "${{ inputs.enableGradleEnterprise }}" == "true" ]; then ARG_GE_ENABLE="${{ inputs.enableGradleEnterprise }}" fi + if [ "${{ inputs.enableDeveocity }}" == "true" ]; then + ARG_GE_ENABLE="${{ inputs.enableDeveocity }}" + fi # Navigate into the folder containing the validation scripts cd gradle-enterprise-gradle-build-validation diff --git a/.github/actions/gradle/experiment-2/action.yml b/.github/actions/gradle/experiment-2/action.yml index f211ae4d..d36e1a5d 100644 --- a/.github/actions/gradle/experiment-2/action.yml +++ b/.github/actions/gradle/experiment-2/action.yml @@ -23,10 +23,18 @@ inputs: args: description: "Additional arguments to pass to Gradle" required: false + develocityUrl: + description: "The URL for the Develocity server to connect to" + required: false gradleEnterpriseUrl: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'develocityUrl' instead." description: "The URL for the Gradle Enterprise server to connect to" required: false + enableDevelocity: + description: "Enables Develocity on a project not already connected" + required: false enableGradleEnterprise: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'enableDevelocity' instead." description: "Enables Gradle Enterprise on a project not already connected" required: false failIfNotFullyCacheable: @@ -79,10 +87,16 @@ runs: if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then ARG_GE_URL="${{ inputs.gradleEnterpriseUrl }}" fi + if [ ! -z "${{ inputs.develocityUrl }}" ]; then + ARG_GE_URL="${{ inputs.develocityUrl }}" + fi ARG_GE_ENABLE="" if [ "${{ inputs.enableGradleEnterprise }}" == "true" ]; then ARG_GE_ENABLE="${{ inputs.enableGradleEnterprise }}" fi + if [ "${{ inputs.enableDeveocity }}" == "true" ]; then + ARG_GE_ENABLE="${{ inputs.enableDeveocity }}" + fi ARG_FAIL_IF_NOT_FULLY_CACHEABLE="" if [ "${{ inputs.failIfNotFullyCacheable }}" == "true" ]; then ARG_FAIL_IF_NOT_FULLY_CACHEABLE="${{ inputs.failIfNotFullyCacheable }}" diff --git a/.github/actions/gradle/experiment-3/action.yml b/.github/actions/gradle/experiment-3/action.yml index 78126940..f993f97b 100644 --- a/.github/actions/gradle/experiment-3/action.yml +++ b/.github/actions/gradle/experiment-3/action.yml @@ -23,10 +23,18 @@ inputs: args: description: "Additional arguments to pass to Gradle" required: false + develocityUrl: + description: "The URL for the Develocity server to connect to" + required: false gradleEnterpriseUrl: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'develocityUrl' instead." description: "The URL for the Gradle Enterprise server to connect to" required: false + enableDevelocity: + description: "Enables Develocity on a project not already connected" + required: false enableGradleEnterprise: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'enableDevelocity' instead." description: "Enables Gradle Enterprise on a project not already connected" required: false failIfNotFullyCacheable: @@ -79,10 +87,16 @@ runs: if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then ARG_GE_URL="${{ inputs.gradleEnterpriseUrl }}" fi + if [ ! -z "${{ inputs.develocityUrl }}" ]; then + ARG_GE_URL="${{ inputs.develocityUrl }}" + fi ARG_GE_ENABLE="" if [ "${{ inputs.enableGradleEnterprise }}" == "true" ]; then ARG_GE_ENABLE="${{ inputs.enableGradleEnterprise }}" fi + if [ "${{ inputs.enableDeveocity }}" == "true" ]; then + ARG_GE_ENABLE="${{ inputs.enableDeveocity }}" + fi ARG_FAIL_IF_NOT_FULLY_CACHEABLE="" if [ "${{ inputs.failIfNotFullyCacheable }}" == "true" ]; then ARG_FAIL_IF_NOT_FULLY_CACHEABLE="${{ inputs.failIfNotFullyCacheable }}" diff --git a/.github/actions/maven/experiment-1/action.yml b/.github/actions/maven/experiment-1/action.yml index 2ba84dd8..18ce3fa5 100644 --- a/.github/actions/maven/experiment-1/action.yml +++ b/.github/actions/maven/experiment-1/action.yml @@ -23,10 +23,18 @@ inputs: args: description: "Additional arguments to pass to Maven" required: false + develocityUrl: + description: "The URL for the Develocity server to connect to" + required: false gradleEnterpriseUrl: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'develocityUrl' instead." description: "The URL for the Gradle Enterprise server to connect to" required: false + enableDevelocity: + description: "Enables Develocity on a project not already connected" + required: false enableGradleEnterprise: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'enableDevelocity' instead." description: "Enables Gradle Enterprise on a project not already connected" required: false failIfNotFullyCacheable: @@ -79,10 +87,16 @@ runs: if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then ARG_GE_URL="${{ inputs.gradleEnterpriseUrl }}" fi + if [ ! -z "${{ inputs.develocityUrl }}" ]; then + ARG_GE_URL="${{ inputs.develocityUrl }}" + fi ARG_GE_ENABLE="" if [ "${{ inputs.enableGradleEnterprise }}" == "true" ]; then ARG_GE_ENABLE="${{ inputs.enableGradleEnterprise }}" fi + if [ "${{ inputs.enableDeveocity }}" == "true" ]; then + ARG_GE_ENABLE="${{ inputs.enableDeveocity }}" + fi ARG_FAIL_IF_NOT_FULLY_CACHEABLE="" if [ "${{ inputs.failIfNotFullyCacheable }}" == "true" ]; then ARG_FAIL_IF_NOT_FULLY_CACHEABLE="${{ inputs.failIfNotFullyCacheable }}" diff --git a/.github/actions/maven/experiment-2/action.yml b/.github/actions/maven/experiment-2/action.yml index 13878496..2e87f9eb 100644 --- a/.github/actions/maven/experiment-2/action.yml +++ b/.github/actions/maven/experiment-2/action.yml @@ -23,10 +23,18 @@ inputs: args: description: "Additional arguments to pass to Maven" required: false + develocityUrl: + description: "The URL for the Develocity server to connect to" + required: false gradleEnterpriseUrl: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'develocityUrl' instead." description: "The URL for the Gradle Enterprise server to connect to" required: false + enableDevelocity: + description: "Enables Develocity on a project not already connected" + required: false enableGradleEnterprise: + deprecationMessage: "This parameter is deprecated and will be removed in a future release. Use 'enableDevelocity' instead." description: "Enables Gradle Enterprise on a project not already connected" required: false failIfNotFullyCacheable: @@ -79,10 +87,16 @@ runs: if [ ! -z "${{ inputs.gradleEnterpriseUrl }}" ]; then ARG_GE_URL="${{ inputs.gradleEnterpriseUrl }}" fi + if [ ! -z "${{ inputs.develocityUrl }}" ]; then + ARG_GE_URL="${{ inputs.develocityUrl }}" + fi ARG_GE_ENABLE="" if [ "${{ inputs.enableGradleEnterprise }}" == "true" ]; then ARG_GE_ENABLE="${{ inputs.enableGradleEnterprise }}" fi + if [ "${{ inputs.enableDeveocity }}" == "true" ]; then + ARG_GE_ENABLE="${{ inputs.enableDeveocity }}" + fi ARG_FAIL_IF_NOT_FULLY_CACHEABLE="" if [ "${{ inputs.failIfNotFullyCacheable }}" == "true" ]; then ARG_FAIL_IF_NOT_FULLY_CACHEABLE="${{ inputs.failIfNotFullyCacheable }}" From 87102d0d8a1a036d9e5e4c95d9557ddd1798a2e9 Mon Sep 17 00:00:00 2001 From: Eric Haag <ehaag@gradle.com> Date: Thu, 24 Oct 2024 16:32:04 -0500 Subject: [PATCH 3/4] Add Develocity-branded command line options Gradle Enterprise command line options are deprecated. --- components/scripts/lib/cli-parsers/common.m4 | 6 ++++-- components/scripts/lib/config.sh | 21 ++++++++++++++++---- components/scripts/lib/help.sh | 4 ++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/components/scripts/lib/cli-parsers/common.m4 b/components/scripts/lib/cli-parsers/common.m4 index b340d63f..56b235af 100644 --- a/components/scripts/lib/cli-parsers/common.m4 +++ b/components/scripts/lib/cli-parsers/common.m4 @@ -6,8 +6,10 @@ # ARG_OPTIONAL_SINGLE([git-options],[o],[],[--depth=1]) # ARG_OPTIONAL_SINGLE([project-dir],[p],[],[]) # ARG_OPTIONAL_SINGLE([args],[a],[]) -# ARG_OPTIONAL_SINGLE([gradle-enterprise-server],[s],[],[]) -# ARG_OPTIONAL_BOOLEAN([enable-gradle-enterprise],[e],[]) +# ARG_OPTIONAL_SINGLE([develocity-server],[s],[],[]) +# ARG_OPTIONAL_SINGLE([gradle-enterprise-server],[],[]) +# ARG_OPTIONAL_BOOLEAN([enable-develocity],[e],[]) +# ARG_OPTIONAL_BOOLEAN([enable-gradle-enterprise],[],[]) # ARG_OPTIONAL_BOOLEAN([interactive],[i],[],[off]) # ARG_OPTIONAL_BOOLEAN([debug],[],[],[off]) # ARGBASH_GO() diff --git a/components/scripts/lib/config.sh b/components/scripts/lib/config.sh index 55998c01..42ad3968 100644 --- a/components/scripts/lib/config.sh +++ b/components/scripts/lib/config.sh @@ -7,6 +7,17 @@ process_args() { print_bl validate_required_args + check_legacy_options +} + +check_legacy_options() { + if [ -n "${_arg_gradle_enterprise_server}" ]; then + warnings+=("The --gradle-enterprise-server command line argument is deprecated and will be removed in a future release. Use --develocity-server instead.") + fi + + if [ "${_arg_enable_gradle_enterprise}" == "on" ]; then + warnings+=("The --enable-gradle-enterprise command line argument is deprecated and will be removed in a future release. Use --enable-develocity instead.") + fi } map_common_script_args() { @@ -49,12 +60,14 @@ map_common_script_args() { mapping_file="${_arg_mapping_file}" fi - if [ -n "${_arg_gradle_enterprise_server+x}" ]; then - ge_server="${_arg_gradle_enterprise_server}" + ge_server="${_arg_gradle_enterprise_server}" + if [ -n "${_arg_develocity_server}" ]; then + ge_server="${_arg_develocity_server}" fi - if [ -n "${_arg_enable_gradle_enterprise+x}" ]; then - enable_ge="${_arg_enable_gradle_enterprise}" + enable_ge="${_arg_enable_gradle_enterprise}" + if [ "${_arg_enable_develocity}" == "on" ]; then + enable_ge="${_arg_enable_develocity}" fi if [ -n "${_arg_fail_if_not_fully_cacheable+x}" ]; then diff --git a/components/scripts/lib/help.sh b/components/scripts/lib/help.sh index eecba5b4..a2bb9f52 100644 --- a/components/scripts/lib/help.sh +++ b/components/scripts/lib/help.sh @@ -40,10 +40,10 @@ print_option_usage() { _print_option_usage "-m, --mapping-file" "Specifies the mapping file for the custom value names used in the build scans." ;; -s) - _print_option_usage "-s, --gradle-enterprise-server" "Specifies the URL for the Gradle Enterprise server to connect to." + _print_option_usage "-s, --develocity-server" "Specifies the URL for the Develocity server to connect to." ;; -e) - _print_option_usage "-e, --enable-gradle-enterprise" "Enables Gradle Enterprise on a project not already connected." + _print_option_usage "-e, --enable-develocity" "Enables Develocity on a project not already connected." ;; -f) _print_option_usage "-f, --fail-if-not-fully-cacheable" "Terminates with exit code ${BUILD_NOT_FULLY_CACHEABLE} if the build is not fully cacheable." From 9ab1005527f0cf9c992527d6246211f31438f1ea Mon Sep 17 00:00:00 2001 From: Eric Haag <ehaag@gradle.com> Date: Fri, 25 Oct 2024 14:23:17 -0500 Subject: [PATCH 4/4] Add Develocity-branded distributions --- .github/actions/gradle/download/action.yml | 6 +- .../actions/gradle/experiment-1/action.yml | 4 +- .../actions/gradle/experiment-2/action.yml | 4 +- .../actions/gradle/experiment-3/action.yml | 4 +- .github/actions/maven/download/action.yml | 8 +-- .github/actions/maven/experiment-1/action.yml | 4 +- .github/actions/maven/experiment-2/action.yml | 4 +- ...oss-platform-testing-build-from-source.yml | 53 +++++++-------- ...atform-testing-use-development-release.yml | 53 +++++++-------- Gradle.md | 1 + Maven.md | 1 + build.gradle.kts | 65 +++++++++++++------ components/scripts/lib/config.sh | 6 ++ 13 files changed, 115 insertions(+), 98 deletions(-) diff --git a/.github/actions/gradle/download/action.yml b/.github/actions/gradle/download/action.yml index 6459cf30..a7119d08 100644 --- a/.github/actions/gradle/download/action.yml +++ b/.github/actions/gradle/download/action.yml @@ -20,11 +20,11 @@ runs: fi # Get the download url of the latest release - downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep -v maven) + downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-gradle) # Download the latest version of the build validation scripts - curl "${curlOpts[@]}" --output gradle-enterprise-gradle-build-validation.zip $downloadUrl + curl "${curlOpts[@]}" --output develocity-gradle-build-validation.zip $downloadUrl # Unzip the downloaded build validation scripts - unzip -q -o gradle-enterprise-gradle-build-validation.zip + unzip -q -o develocity-gradle-build-validation.zip shell: bash diff --git a/.github/actions/gradle/experiment-1/action.yml b/.github/actions/gradle/experiment-1/action.yml index aa589132..806a9e94 100644 --- a/.github/actions/gradle/experiment-1/action.yml +++ b/.github/actions/gradle/experiment-1/action.yml @@ -96,7 +96,7 @@ runs: fi # Navigate into the folder containing the validation scripts - cd gradle-enterprise-gradle-build-validation + cd develocity-gradle-build-validation # Run the experiment ./01-validate-incremental-building.sh \ @@ -126,7 +126,7 @@ runs: uses: actions/upload-artifact@v4 with: name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }} - path: gradle-enterprise-gradle-build-validation/.data/01-validate-incremental-building/latest*/exp1-*.receipt + path: develocity-gradle-build-validation/.data/01-validate-incremental-building/latest*/exp1-*.receipt - name: Add artifact link to summary run: | echo "-------------" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/gradle/experiment-2/action.yml b/.github/actions/gradle/experiment-2/action.yml index d36e1a5d..ccdb528a 100644 --- a/.github/actions/gradle/experiment-2/action.yml +++ b/.github/actions/gradle/experiment-2/action.yml @@ -103,7 +103,7 @@ runs: fi # Navigate into the folder containing the validation scripts - cd gradle-enterprise-gradle-build-validation + cd develocity-gradle-build-validation # Run the experiment ./02-validate-local-build-caching-same-location.sh \ @@ -134,7 +134,7 @@ runs: uses: actions/upload-artifact@v4 with: name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }} - path: gradle-enterprise-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest*/exp2-*.receipt + path: develocity-gradle-build-validation/.data/02-validate-local-build-caching-same-location/latest*/exp2-*.receipt - name: Add artifact link to summary run: | echo "-------------" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/gradle/experiment-3/action.yml b/.github/actions/gradle/experiment-3/action.yml index f993f97b..d0181a1e 100644 --- a/.github/actions/gradle/experiment-3/action.yml +++ b/.github/actions/gradle/experiment-3/action.yml @@ -103,7 +103,7 @@ runs: fi # Navigate into the folder containing the validation scripts - cd gradle-enterprise-gradle-build-validation + cd develocity-gradle-build-validation # Run the experiment ./03-validate-local-build-caching-different-locations.sh \ @@ -134,7 +134,7 @@ runs: uses: actions/upload-artifact@v4 with: name: experiment-3-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }} - path: gradle-enterprise-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest*/exp3-*.receipt + path: develocity-gradle-build-validation/.data/03-validate-local-build-caching-different-locations/latest*/exp3-*.receipt - name: Add artifact link to summary run: | echo "-------------" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/maven/download/action.yml b/.github/actions/maven/download/action.yml index 7c67ccfd..a77c30dd 100644 --- a/.github/actions/maven/download/action.yml +++ b/.github/actions/maven/download/action.yml @@ -20,11 +20,11 @@ runs: fi # Get the download url of the latest release - downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep maven) - + downloadUrl=$(curl "${curlOpts[@]}" https://api.github.com/repos/gradle/gradle-enterprise-build-validation-scripts/releases/latest | jq -c '.assets[] | select(.content_type == "application/zip")' | jq -r .browser_download_url | grep develocity-maven) + # Download the latest version of the build validation scripts - curl "${curlOpts[@]}" --output gradle-enterprise-maven-build-validation.zip $downloadUrl + curl "${curlOpts[@]}" --output develocity-maven-build-validation.zip $downloadUrl # Unzip the downloaded build validation scripts - unzip -q -o gradle-enterprise-maven-build-validation.zip + unzip -q -o develocity-maven-build-validation.zip shell: bash diff --git a/.github/actions/maven/experiment-1/action.yml b/.github/actions/maven/experiment-1/action.yml index 18ce3fa5..2375b0c7 100644 --- a/.github/actions/maven/experiment-1/action.yml +++ b/.github/actions/maven/experiment-1/action.yml @@ -103,7 +103,7 @@ runs: fi # Navigate into the folder containing the validation scripts - cd gradle-enterprise-maven-build-validation + cd develocity-maven-build-validation # Run the experiment ./01-validate-local-build-caching-same-location.sh \ @@ -134,7 +134,7 @@ runs: uses: actions/upload-artifact@v4 with: name: experiment-1-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }} - path: gradle-enterprise-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest*/exp1-*.receipt + path: develocity-maven-build-validation/.data/01-validate-local-build-caching-same-location/latest*/exp1-*.receipt - name: Add artifact link to summary run: | echo "-------------" >> $GITHUB_STEP_SUMMARY diff --git a/.github/actions/maven/experiment-2/action.yml b/.github/actions/maven/experiment-2/action.yml index 2e87f9eb..1de2c6da 100644 --- a/.github/actions/maven/experiment-2/action.yml +++ b/.github/actions/maven/experiment-2/action.yml @@ -103,7 +103,7 @@ runs: fi # Navigate into the folder containing the validation scripts - cd gradle-enterprise-maven-build-validation + cd develocity-maven-build-validation # Run the experiment ./02-validate-local-build-caching-different-locations.sh \ @@ -134,7 +134,7 @@ runs: uses: actions/upload-artifact@v4 with: name: experiment-2-receipt-${{ github.job }}${{ strategy.job-total > 1 && format('-{0}', strategy.job-index) || '' }} - path: gradle-enterprise-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest*/exp2-*.receipt + path: develocity-maven-build-validation/.data/02-validate-local-build-caching-different-locations/latest*/exp2-*.receipt - name: Add artifact link to summary run: | echo "-------------" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/cross-platform-testing-build-from-source.yml b/.github/workflows/cross-platform-testing-build-from-source.yml index 69e14af8..95af0b40 100644 --- a/.github/workflows/cross-platform-testing-build-from-source.yml +++ b/.github/workflows/cross-platform-testing-build-from-source.yml @@ -25,8 +25,8 @@ jobs: with: name: artifacts path: | - build/distributions/gradle-enterprise-gradle-build-validation-*.zip - build/distributions/gradle-enterprise-maven-build-validation-*.zip + build/distributions/develocity-gradle-build-validation-*.zip + build/distributions/develocity-maven-build-validation-*.zip cross_platform_tests: name: Test @@ -85,41 +85,32 @@ jobs: name: artifacts - name: Extract build validation scripts run: | - unzip -o gradle-enterprise-gradle-build-validation-*.zip - unzip -o gradle-enterprise-maven-build-validation-*.zip + unzip -o develocity-gradle-build-validation-*.zip + unzip -o develocity-maven-build-validation-*.zip - name: Run Gradle Experiment 01 - run: | - cd gradle-enterprise-gradle-build-validation - ./01-validate-incremental-building.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./01-validate-incremental-building.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 02 - run: | - cd gradle-enterprise-gradle-build-validation - ./02-validate-local-build-caching-same-location.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./02-validate-local-build-caching-same-location.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 03 - run: | - cd gradle-enterprise-gradle-build-validation - ./03-validate-local-build-caching-different-locations.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./03-validate-local-build-caching-different-locations.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 04 - run: | - cd gradle-enterprise-gradle-build-validation - ./04-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/p4ghldkcscfwi -2 https://ge.solutions-team.gradle.com/s/jhzljnet32x5m + working-directory: develocity-gradle-build-validation + run: ./04-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/p4ghldkcscfwi -2 https://ge.solutions-team.gradle.com/s/jhzljnet32x5m - name: Run Gradle Experiment 05 - run: | - cd gradle-enterprise-gradle-build-validation - ./05-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/cemwsttqjhzhq -s https://ge.solutions-team.gradle.com -u https://ge.solutions-team.gradle.com/cache/ + working-directory: develocity-gradle-build-validation + run: ./05-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/cemwsttqjhzhq -s https://ge.solutions-team.gradle.com -u https://ge.solutions-team.gradle.com/cache/ - name: Run Maven Experiment 01 - run: | - cd gradle-enterprise-maven-build-validation - ./01-validate-local-build-caching-same-location.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./01-validate-local-build-caching-same-location.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com - name: Run Maven Experiment 02 - run: | - cd gradle-enterprise-maven-build-validation - ./02-validate-local-build-caching-different-locations.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./02-validate-local-build-caching-different-locations.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com - name: Run Maven Experiment 03 - run: | - cd gradle-enterprise-maven-build-validation - ./03-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/sysk4hrdbkja6 -2 https://ge.solutions-team.gradle.com/s/f7yfwfxqzg5us + working-directory: develocity-maven-build-validation + run: ./03-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/sysk4hrdbkja6 -2 https://ge.solutions-team.gradle.com/s/f7yfwfxqzg5us - name: Run Maven Experiment 04 - run: | - cd gradle-enterprise-maven-build-validation - ./04-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/6jgkaknikci2c -e -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./04-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/6jgkaknikci2c -e -s https://ge.solutions-team.gradle.com diff --git a/.github/workflows/cross-platform-testing-use-development-release.yml b/.github/workflows/cross-platform-testing-use-development-release.yml index a70832c1..4a41914b 100644 --- a/.github/workflows/cross-platform-testing-use-development-release.yml +++ b/.github/workflows/cross-platform-testing-use-development-release.yml @@ -60,43 +60,34 @@ jobs: distribution: ${{ matrix.os == 'macos-14' && 'zulu' || 'temurin' }} # No Temurin JDK 8 distribution for aarch64 - name: Download and extract build validation Scripts run: | - curl -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/development-latest/gradle-enterprise-gradle-build-validation-dev.zip - unzip -o gradle-enterprise-gradle-build-validation-*.zip - curl -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/development-latest/gradle-enterprise-maven-build-validation-dev.zip - unzip -o gradle-enterprise-maven-build-validation-*.zip + curl -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/development-latest/develocity-gradle-build-validation-dev.zip + unzip -o develocity-gradle-build-validation-*.zip + curl -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/development-latest/develocity-maven-build-validation-dev.zip + unzip -o develocity-maven-build-validation-*.zip - name: Run Gradle Experiment 01 - run: | - cd gradle-enterprise-gradle-build-validation - ./01-validate-incremental-building.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./01-validate-incremental-building.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 02 - run: | - cd gradle-enterprise-gradle-build-validation - ./02-validate-local-build-caching-same-location.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./02-validate-local-build-caching-same-location.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 03 - run: | - cd gradle-enterprise-gradle-build-validation - ./03-validate-local-build-caching-different-locations.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com + working-directory: develocity-gradle-build-validation + run: ./03-validate-local-build-caching-different-locations.sh -r https://github.com/etiennestuder/java-ordered-properties -t build -s https://ge.solutions-team.gradle.com - name: Run Gradle Experiment 04 - run: | - cd gradle-enterprise-gradle-build-validation - ./04-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/p4ghldkcscfwi -2 https://ge.solutions-team.gradle.com/s/jhzljnet32x5m + working-directory: develocity-gradle-build-validation + run: ./04-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/p4ghldkcscfwi -2 https://ge.solutions-team.gradle.com/s/jhzljnet32x5m - name: Run Gradle Experiment 05 - run: | - cd gradle-enterprise-gradle-build-validation - ./05-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/cemwsttqjhzhq -s https://ge.solutions-team.gradle.com -u https://ge.solutions-team.gradle.com/cache/ + working-directory: develocity-gradle-build-validation + run: ./05-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/cemwsttqjhzhq -s https://ge.solutions-team.gradle.com -u https://ge.solutions-team.gradle.com/cache/ - name: Run Maven Experiment 01 - run: | - cd gradle-enterprise-maven-build-validation - ./01-validate-local-build-caching-same-location.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./01-validate-local-build-caching-same-location.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com - name: Run Maven Experiment 02 - run: | - cd gradle-enterprise-maven-build-validation - ./02-validate-local-build-caching-different-locations.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./02-validate-local-build-caching-different-locations.sh -r https://github.com/gradle/maven-build-scan-quickstart.git -g test -s https://ge.solutions-team.gradle.com - name: Run Maven Experiment 03 - run: | - cd gradle-enterprise-maven-build-validation - ./03-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/sysk4hrdbkja6 -2 https://ge.solutions-team.gradle.com/s/f7yfwfxqzg5us + working-directory: develocity-maven-build-validation + run: ./03-validate-remote-build-caching-ci-ci.sh -1 https://ge.solutions-team.gradle.com/s/sysk4hrdbkja6 -2 https://ge.solutions-team.gradle.com/s/f7yfwfxqzg5us - name: Run Maven Experiment 04 - run: | - cd gradle-enterprise-maven-build-validation - ./04-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/6jgkaknikci2c -e -s https://ge.solutions-team.gradle.com + working-directory: develocity-maven-build-validation + run: ./04-validate-remote-build-caching-ci-local.sh -1 https://ge.solutions-team.gradle.com/s/6jgkaknikci2c -e -s https://ge.solutions-team.gradle.com diff --git a/Gradle.md b/Gradle.md index be51c99f..c34a7fce 100644 --- a/Gradle.md +++ b/Gradle.md @@ -25,6 +25,7 @@ The build validation scripts are compatible with a large range of Gradle version Use the following command to download and unpack the build validation scripts for Gradle to the current directory: +[//]: # (TODO SHOULD BE UPDATED TO DEVELOCITY DISTRIBUTION NEXT RELEASE) ```bash curl -s -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/v2.6/gradle-enterprise-gradle-build-validation-2.6.zip && unzip -q -o gradle-enterprise-gradle-build-validation-2.6.zip ``` diff --git a/Maven.md b/Maven.md index 714a1596..68eda780 100644 --- a/Maven.md +++ b/Maven.md @@ -25,6 +25,7 @@ The build validation scripts are compatible with a large range of Maven versions Use the following command to download and unpack the build validation scripts for Maven to the current directory: +[//]: # (TODO SHOULD BE UPDATED TO DEVELOCITY DISTRIBUTION NEXT RELEASE) ```bash curl -s -L -O https://github.com/gradle/gradle-enterprise-build-validation-scripts/releases/download/v2.6/gradle-enterprise-maven-build-validation-2.6.zip && unzip -q -o gradle-enterprise-maven-build-validation-2.6.zip ``` diff --git a/build.gradle.kts b/build.gradle.kts index a8248bbd..caeacef1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -250,10 +250,36 @@ val copyMavenScripts by tasks.registering(Sync::class) { into(layout.buildDirectory.dir("scripts/maven")) } +val copyLegacyGradleScripts by tasks.registering(Sync::class) { + group = "build" + description = "Copies the Gradle source and the generated scripts to the output directory." + from(copyGradleScripts) { + exclude("lib/scripts/config.sh") + } + from(copyGradleScripts) { + include("lib/scripts/config.sh") + filter { line: String -> line.replace("LEGACY_DISTRIBUTION=\"false\"", "LEGACY_DISTRIBUTION=\"true\"") } + } + into(layout.buildDirectory.dir("scripts/gradle-legacy")) +} + +val copyLegacyMavenScripts by tasks.registering(Sync::class) { + group = "build" + description = "Copies the Maven source and the generated scripts to the output directory." + from(copyMavenScripts) { + exclude("lib/scripts/config.sh") + } + from(copyMavenScripts) { + include("lib/scripts/config.sh") + filter { line: String -> line.replace("LEGACY_DISTRIBUTION=\"false\"", "LEGACY_DISTRIBUTION=\"true\"") } + } + into(layout.buildDirectory.dir("scripts/maven-legacy")) +} + val assembleGradleScripts by tasks.registering(Zip::class) { group = "build" description = "Packages the Gradle experiment scripts in a zip archive." - archiveBaseName.set("gradle-enterprise-gradle-build-validation") + archiveBaseName.set("develocity-gradle-build-validation") archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } }) from(copyGradleScripts) into(archiveBaseName.get()) @@ -262,31 +288,32 @@ val assembleGradleScripts by tasks.registering(Zip::class) { val assembleMavenScripts by tasks.registering(Zip::class) { group = "build" description = "Packages the Maven experiment scripts in a zip archive." - archiveBaseName.set("gradle-enterprise-maven-build-validation") + archiveBaseName.set("develocity-maven-build-validation") archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } }) from(copyMavenScripts) into(archiveBaseName.get()) } -tasks.assemble { - dependsOn(assembleGradleScripts, assembleMavenScripts) -} - -val consumableGradleScripts by configurations.creating { - isCanBeConsumed = true - isCanBeResolved = false - attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named("gradle-build-validation-scripts")) +val assembleLegacyGradleScripts by tasks.registering(Zip::class) { + group = "build" + description = "Packages the Gradle experiment scripts in a zip archive." + archiveBaseName.set("gradle-enterprise-gradle-build-validation") + archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } }) + from(copyLegacyGradleScripts) + into(archiveBaseName.get()) } -val consumableMavenScripts by configurations.creating { - isCanBeConsumed = true - isCanBeResolved = false - attributes.attribute(Usage.USAGE_ATTRIBUTE, objects.named("maven-build-validation-scripts")) +val assembleLegacyMavenScripts by tasks.registering(Zip::class) { + group = "build" + description = "Packages the Maven experiment scripts in a zip archive." + archiveBaseName.set("gradle-enterprise-maven-build-validation") + archiveFileName.set(archiveBaseName.flatMap { a -> distributionVersion.map { v -> "$a-$v.zip" } }) + from(copyLegacyMavenScripts) + into(archiveBaseName.get()) } -artifacts { - add(consumableGradleScripts.name, assembleGradleScripts) - add(consumableMavenScripts.name, assembleMavenScripts) +tasks.assemble { + dependsOn(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts) } val shellcheckGradleScripts by tasks.registering(Shellcheck::class) { @@ -338,7 +365,7 @@ tasks.check { val generateChecksums by tasks.registering(Checksum::class) { group = "distribution" description = "Generates checksums for the distribution zip files." - inputFiles.setFrom(assembleGradleScripts, assembleMavenScripts) + inputFiles.setFrom(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts) outputDirectory.set(layout.buildDirectory.dir("distributions/checksums").get().asFile) checksumAlgorithm.set(Checksum.Algorithm.SHA512) } @@ -354,7 +381,7 @@ githubRelease { overwrite.set(isDevelopmentRelease) generateReleaseNotes.set(false) body.set(releaseNotes) - releaseAssets(assembleGradleScripts, assembleMavenScripts, generateChecksums.map { it.outputs.files.asFileTree }) + releaseAssets(assembleGradleScripts, assembleMavenScripts, assembleLegacyGradleScripts, assembleLegacyMavenScripts, generateChecksums.map { it.outputs.files.asFileTree }) } val createReleaseTag by tasks.registering(CreateGitTag::class) { diff --git a/components/scripts/lib/config.sh b/components/scripts/lib/config.sh index 42ad3968..deccda4c 100644 --- a/components/scripts/lib/config.sh +++ b/components/scripts/lib/config.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +readonly LEGACY_DISTRIBUTION="false" + process_args() { parse_commandline "$@" map_common_script_args @@ -11,6 +13,10 @@ process_args() { } check_legacy_options() { + if [ "${LEGACY_DISTRIBUTION}" == "true" ]; then + warnings+=("The distribution of the Develocity Build Validation Scripts prefixed with 'gradle-enterprise' is deprecated and will be removed in a future release. Migrate to the distribution prefixed with 'develocity' instead.") + fi + if [ -n "${_arg_gradle_enterprise_server}" ]; then warnings+=("The --gradle-enterprise-server command line argument is deprecated and will be removed in a future release. Use --develocity-server instead.") fi