1
1
#! /usr/bin/env bash
2
2
3
3
invoke_gradle () {
4
- local run_num
4
+ local run_num args
5
+ args=()
5
6
run_num=$1
6
7
shift
7
8
@@ -11,45 +12,35 @@ invoke_gradle() {
11
12
cd " ${project_dir} " > /dev/null 2>&1 || die " ERROR: Subdirectory ${project_dir} (set with --project-dir) does not exist in ${project_name} " " ${INVALID_INPUT} "
12
13
fi
13
14
14
- envs+=(
15
- DEVELOCITY_INJECTION_INIT_SCRIPT_NAME=develocity-injection.gradle
16
- DEVELOCITY_INJECTION_ENABLED=true
15
+ args+=(
16
+ --init-script " ${INIT_SCRIPTS_DIR} /develocity-injection.gradle"
17
+ --init-script " ${INIT_SCRIPTS_DIR} /configure-build-validation.gradle"
18
+ -Ddevelocity.injection.init-script-name=develocity-injection.gradle
19
+ -Ddevelocity.injection-enabled=true
17
20
)
18
21
19
22
if [ " $enable_ge " == " on" ]; then
20
- envs +=(
21
- GRADLE_PLUGIN_REPOSITORY_URL =https://plugins.gradle.org/m2
22
- DEVELOCITY_PLUGIN_VERSION =" 3.14.1"
23
- DEVELOCITY_CCUD_PLUGIN_VERSION =" 2.0.2"
23
+ args +=(
24
+ -Dgradle.plugin-repository.url =https://plugins.gradle.org/m2
25
+ -Ddevelocity.plugin.version =" 3.14.1"
26
+ -Ddevelocity.ccud.plugin.version =" 2.0.2"
24
27
)
25
28
fi
26
29
27
30
if [ -n " ${ge_server} " ]; then
28
- envs+=(
29
- DEVELOCITY_BUILD_VALIDATION_URL=" ${ge_server} "
30
- DEVELOCITY_BUILD_VALIDATION_ALLOW_UNTRUSTED_SERVER=false
31
- )
32
- fi
33
-
34
- if [ -n " ${remote_build_cache_url} " ]; then
35
- envs+=(
36
- DEVELOCITY_BUILD_VALIDATION_REMOTEBUILDCACHEURL=" ${remote_build_cache_url} "
31
+ args+=(
32
+ -Ddevelocity.build-validation.url=" ${ge_server} "
33
+ -Ddevelocity.build-validation.allow-untrusted-server=false
37
34
)
38
35
fi
39
36
40
- envs+=(
41
- DEVELOCITY_BUILD_VALIDATION_EXPDIR=" ${EXP_DIR} "
42
- DEVELOCITY_BUILD_VALIDATION_EXPID=" ${EXP_SCAN_TAG} "
43
- DEVELOCITY_BUILD_VALIDATION_RUNID=" ${RUN_ID} "
44
- DEVELOCITY_BUILD_VALIDATION_RUNNUM=" ${run_num} "
45
- DEVELOCITY_BUILD_VALIDATION_SCRIPTSVERSION=" ${SCRIPT_VERSION} "
46
- DEVELOCITY_CAPTURE_FILE_FINGERPRINTS=true
47
- )
48
-
49
- local args
50
- args=(
51
- --init-script " ${INIT_SCRIPTS_DIR} /develocity-injection.gradle"
52
- --init-script " ${INIT_SCRIPTS_DIR} /configure-build-validation.gradle"
37
+ args+=(
38
+ -Ddevelocity.build-validation.expDir=" ${EXP_DIR} "
39
+ -Ddevelocity.build-validation.expId=" ${EXP_SCAN_TAG} "
40
+ -Ddevelocity.build-validation.runId=" ${RUN_ID} "
41
+ -Ddevelocity.build-validation.runNum=" ${run_num} "
42
+ -Ddevelocity.build-validation.scriptsVersion=" ${SCRIPT_VERSION} "
43
+ -Ddevelocity.capture-file-fingerprints=true
53
44
-Dpts.enabled=false
54
45
)
55
46
@@ -66,13 +57,9 @@ invoke_gradle() {
66
57
rm -f " ${EXP_DIR} /errors.txt"
67
58
68
59
debug " Current directory: $( pwd) "
69
- # shellcheck disable=SC2145
70
- debug export " ${envs[@]} " ' ;' ./gradlew " ${args[@]} "
60
+ debug ./gradlew " ${args[@]} "
71
61
72
- # The parenthesis below will intentionally create a subshell. This causes the
73
- # environment variables to only be exported for the child process and not leak
74
- # to the rest of the script.
75
- if (export " ${envs[@]} " ; ./gradlew " ${args[@]} " ); then
62
+ if ./gradlew " ${args[@]} " ; then
76
63
build_outcomes+=(" SUCCESSFUL" )
77
64
else
78
65
build_outcomes+=(" FAILED" )
0 commit comments