You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Develocity and Gradle Enterprise remote build cache connectors are supported (#807)
* Support Develocity and Gradle Enterprise remote build cache connectors
Adds a new command line argument for Gradle experiment 5, `-y` or
`--remote-build-cache-type`, allowing the user to specify a remote build
cache type to use. When specified, valid values are: `develocity`,
`gradle-enterprise`, or `http`. When the argument is specified, it will
always take precedence over what is configured in the build.
If the argument is not specified, the remote build cache type of the
first build will be fetched from the Develocity API and used for the
second build.
If the argument is not specified and the user does not have access to
the Develocity API, then the existing remote build cache configuration
will be used.
* Update user-facing text
* Update release notes
* Extract init script logic to helper functions
* Add 'connector' to help, interactive, and error text
* Bump com.gradle:build-scan-summary from 1.0.3-2024.1 to 1.0.4-2024.1
Bumps com.gradle:build-scan-summary from 1.0.3-2024.1 to 1.0.4-2024.1.
---
updated-dependencies:
- dependency-name: com.gradle:build-scan-summary
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <[email protected]>
---------
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
if [[ "${enable_develocity}"=="on"&&-z"${develocity_server}" ]];then
152
154
_PRINT_HELP=yes die "ERROR: Missing required argument when enabling Develocity on a project not already connected: --develocity-server""${INVALID_INPUT}"
153
155
fi
156
+
157
+
if [[ -n"${remote_build_cache_type}"&&"${remote_build_cache_type}"!='http'&&"${remote_build_cache_type}"!='gradle-enterprise'&&"${remote_build_cache_type}"!='develocity' ]];then
158
+
_PRINT_HELP=yes die "ERROR: Invalid value for argument --remote-build-cache-type. Values are 'develocity', 'gradle-enterprise', or 'http'.""${INVALID_INPUT}"
The local build will connect to the given remote build cache. The remote build
@@ -369,11 +384,30 @@ EOF
369
384
print_interactive_text "${text}"
370
385
}
371
386
387
+
collect_remote_build_cache() {
388
+
collect_remote_build_cache_type
389
+
collect_remote_build_cache_url
390
+
}
391
+
392
+
collect_remote_build_cache_type() {
393
+
local default_remote_cache_type="<project default>"
394
+
prompt_for_setting "What is the remote build cache connector type to use? [develocity, gradle-enterprise, http, or <BLANK>]""${remote_build_cache_type}""${default_remote_cache_type}" remote_build_cache_type
395
+
396
+
if [[ -n"${remote_build_cache_type}"&&"${remote_build_cache_type}"!='http'&&"${remote_build_cache_type}"!='gradle-enterprise'&&"${remote_build_cache_type}"!='develocity' ]];then
397
+
print_bl
398
+
die "ERROR: Invalid value for remote build cache connector type. Values are 'develocity', 'gradle-enterprise', 'http', or <BLANK> for project default.""${INVALID_INPUT}"
399
+
fi
400
+
401
+
if [[ "${remote_build_cache_type}"=="${default_remote_cache_type}" ]];then
402
+
remote_build_cache_type=''
403
+
fi
404
+
}
405
+
372
406
collect_remote_build_cache_url() {
373
-
localdefault_remote_cache="<project default>"
374
-
prompt_for_setting "What is the remote build cache url to use?""${remote_build_cache_url}""${default_remote_cache}" remote_build_cache_url
407
+
localdefault_remote_cache_url="<project default>"
408
+
prompt_for_setting "What is the remote build cache url to use?""${remote_build_cache_url}""${default_remote_cache_url}" remote_build_cache_url
375
409
376
-
if [[ "${remote_build_cache_url}"=="${default_remote_cache}" ]];then
410
+
if [[ "${remote_build_cache_url}"=="${default_remote_cache_url}" ]];then
# ARG_HELP([This function is overridden later on.])
@@ -30,6 +31,7 @@ function print_help() {
30
31
print_option_usage -p
31
32
print_option_usage -t
32
33
print_option_usage -a
34
+
print_option_usage "-y, --remote-build-cache-type""Specifies the remote build cache connector type to use in the second build run locally. Values are 'develocity', 'gradle-enterprise', or 'http'."
33
35
print_option_usage "-u, --remote-build-cache-url""Specifies the URL for the remote build cache to access in the second build run locally."
Copy file name to clipboardExpand all lines: release/changes.md
+2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
> [!IMPORTANT]
2
2
> The distributions of the Develocity Build Validation Scripts prefixed with `gradle-enterprise` are deprecated and will be removed in a future release. Migrate to the distributions prefixed with `develocity` instead.
3
3
4
+
-[NEW] Support Develocity and Gradle Enterprise remote build cache connectors in the Gradle CI/Local experiment
5
+
-[NEW] Better handling of remote build cache misconfigurations
4
6
-[FIX] Scripts do not wait long enough for build scans to become available when `--fail-if-not-fully-cacheable` is used
5
7
-[FIX] Successful exit code returned when performance characteristics are unknown and `--fail-if-not-fully-cacheable` is used
6
8
-[FIX] Gradle experiments do not disable background Build Scan publication
0 commit comments