Skip to content

Commit 90a7203

Browse files
committed
Revert "Remove support for offline mode"
This reverts commit 9afb897.
1 parent 9afb897 commit 90a7203

14 files changed

+404
-49
lines changed

Diff for: Gradle.md

+16
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,22 @@ Develocity server at develocity.example.io.
159159
./02-validate-local-build-caching-same-location.sh -i -e -s https://develocity.example.io
160160
```
161161

162+
## Running the experiments without publishing Build Scan data
163+
164+
The scripts that run all builds locally can be configured to not publish any Build Scan data and instead extract the required data
165+
right during the build to surface the state of work avoidance by passing the `-x` or `--disable-build-scan-publishing` command
166+
line argument.
167+
168+
The use of this option requires at least Java 17 to analyze the build data. The JVM version to analyze the build data is
169+
[configurable](#specifying-the-jvm-used-to-analyze-the-build-data). You can still run the builds of the experiments with a JVM
170+
version lower than Java 17.
171+
172+
The use of this configuration option also requires a license file from Gradle Inc. to be present in the root directory of the scripts.
173+
174+
```bash
175+
./02-validate-local-build-caching-same-location.sh -i -x
176+
```
177+
162178
## Specifying the JVM used to analyze the build data
163179

164180
The scripts use a Java-based utility to fetch and analyze the captured build data.

Diff for: Maven.md

+16
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,22 @@ Develocity server at develocity.example.io.
157157
./01-validate-local-build-caching-same-location.sh -i -e -s https://develocity.example.io
158158
```
159159

160+
## Running the experiments without publishing Build Scan data
161+
162+
The scripts that run all builds locally can be configured to not publish any Build Scan data and instead extract the required data
163+
right during the build to surface the state of work avoidance by passing the `-x` or `--disable-build-scan-publishing` command
164+
line argument.
165+
166+
The use of this option requires at least Java 17 to analyze the build data. The JVM version to analyze the build data is
167+
[configurable](#specifying-the-jvm-used-to-analyze-the-build-data). You can still run the builds of the experiments with a JVM
168+
version lower than Java 17.
169+
170+
The use of this configuration option also requires a license file from Gradle Inc. to be present in the root directory of the scripts.
171+
172+
```bash
173+
./01-validate-local-build-caching-same-location.sh -i -x
174+
```
175+
160176
## Specifying the JVM used to analyze the build data
161177

162178
The scripts use a Java-based utility to fetch and analyze the captured build data.

Diff for: components/scripts/gradle/01-validate-incremental-building.sh

+55-7
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ execute() {
7171
wizard_execute() {
7272
print_introduction
7373

74-
print_bl
75-
explain_prerequisites_ccud_gradle_plugin "I."
74+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
75+
print_bl
76+
explain_prerequisites_ccud_gradle_plugin "I."
7677

77-
print_bl
78-
explain_prerequisites_api_access "II."
78+
print_bl
79+
explain_prerequisites_api_access "II."
80+
else
81+
print_bl
82+
explain_prerequisites_ccud_gradle_plugin
83+
fi
7984

8085
print_bl
8186
explain_collect_git_details
@@ -136,11 +141,19 @@ execute_build() {
136141
}
137142

138143
print_gradle_command() {
144+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
139145
info "./gradlew --no-build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} $*$(print_extra_args)"
146+
else
147+
info "./gradlew --no-build-cache -Dscan.dump -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} $*$(print_extra_args)"
148+
fi
140149
}
141150

142151
fetch_build_cache_metrics() {
143-
process_build_scan_data_online
152+
if [ "$build_scan_publishing_mode" == "on" ]; then
153+
process_build_scan_data_online
154+
else
155+
find_and_read_build_scan_dumps
156+
fi
144157
}
145158

146159
# Overrides summary.sh#print_performance_characteristics
@@ -258,7 +271,8 @@ EOF
258271

259272
explain_measure_build_results() {
260273
local text
261-
IFS='' read -r -d '' text <<EOF
274+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
275+
IFS='' read -r -d '' text <<EOF
262276
$(print_separator)
263277
${HEADER_COLOR}Measure build results${RESTORE}
264278
@@ -271,13 +285,30 @@ the two builds to assist you in your investigation.
271285
272286
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
273287
EOF
288+
else
289+
IFS='' read -r -d '' text <<EOF
290+
$(print_separator)
291+
${HEADER_COLOR}Measure build results${RESTORE}
292+
293+
Now that the second build has finished successfully, you are ready to measure
294+
how well your build leverages Gradle’s incremental build functionality for the
295+
invoked set of Gradle tasks.
296+
297+
Some of the build scan data will be extracted from the locally stored,
298+
intermediate build data produced by the two builds to assist you in your
299+
investigation.
300+
301+
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
302+
EOF
303+
fi
274304
print_interactive_text "${text}"
275305
wait_for_enter
276306
}
277307

278308
explain_and_print_summary() {
279309
local text
280-
IFS='' read -r -d '' text <<EOF
310+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
311+
IFS='' read -r -d '' text <<EOF
281312
The ‘Summary’ section below captures the configuration of the experiment and
282313
the two build scans that were published as part of running the experiment. The
283314
build scan of the second build is particularly interesting since this is where
@@ -300,6 +331,23 @@ $(print_command_to_repeat_experiment)
300331
301332
$(explain_when_to_rerun_experiment)
302333
EOF
334+
else
335+
IFS='' read -r -d '' text <<EOF
336+
The ‘Summary’ section below captures the configuration of the experiment. No
337+
build scans are available for inspection since publishing was disabled for the
338+
experiment.
339+
340+
$(explain_performance_characteristics)
341+
342+
$(explain_command_to_repeat_experiment)
343+
344+
$(print_summary)
345+
346+
$(print_command_to_repeat_experiment)
347+
348+
$(explain_when_to_rerun_experiment)
349+
EOF
350+
fi
303351
print_interactive_text "${text}"
304352
}
305353

Diff for: components/scripts/gradle/02-validate-local-build-caching-same-location.sh

+55-8
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,16 @@ execute() {
7272
wizard_execute() {
7373
print_introduction
7474

75-
print_bl
76-
explain_prerequisites_ccud_gradle_plugin "I."
75+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
76+
print_bl
77+
explain_prerequisites_ccud_gradle_plugin "I."
7778

78-
print_bl
79-
explain_prerequisites_api_access "II."
79+
print_bl
80+
explain_prerequisites_api_access "II."
81+
else
82+
print_bl
83+
explain_prerequisites_ccud_gradle_plugin
84+
fi
8085

8186
print_bl
8287
explain_collect_git_details
@@ -141,11 +146,19 @@ execute_build() {
141146
}
142147

143148
print_gradle_command() {
144-
info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
149+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
150+
info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
151+
else
152+
info "./gradlew --build-cache -Dscan.dump -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
153+
fi
145154
}
146155

147156
fetch_build_cache_metrics() {
148-
process_build_scan_data_online
157+
if [ "$build_scan_publishing_mode" == "on" ]; then
158+
process_build_scan_data_online
159+
else
160+
find_and_read_build_scan_dumps
161+
fi
149162
}
150163

151164
print_introduction() {
@@ -236,7 +249,8 @@ EOF
236249

237250
explain_measure_build_results() {
238251
local text
239-
IFS='' read -r -d '' text <<EOF
252+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
253+
IFS='' read -r -d '' text <<EOF
240254
$(print_separator)
241255
${HEADER_COLOR}Measure build results${RESTORE}
242256
@@ -249,13 +263,29 @@ two builds to assist you in your investigation.
249263
250264
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
251265
EOF
266+
else
267+
IFS='' read -r -d '' text <<EOF
268+
$(print_separator)
269+
${HEADER_COLOR}Measure build results${RESTORE}
270+
271+
Now that the second build has finished successfully, you are ready to measure how
272+
well your build leverages Gradle’s local build caching functionality for the
273+
invoked set of Gradle tasks.
274+
275+
Some of the build scan data will be extracted from the locally stored, intermediate
276+
build data produced by the two builds to assist you in your investigation.
277+
278+
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
279+
EOF
280+
fi
252281
print_interactive_text "${text}"
253282
wait_for_enter
254283
}
255284

256285
explain_and_print_summary() {
257286
local text
258-
IFS='' read -r -d '' text <<EOF
287+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
288+
IFS='' read -r -d '' text <<EOF
259289
The ‘Summary’ section below captures the configuration of the experiment and the
260290
two build scans that were published as part of running the experiment. The build
261291
scan of the second build is particularly interesting since this is where you can
@@ -277,6 +307,23 @@ $(print_command_to_repeat_experiment)
277307
278308
$(explain_when_to_rerun_experiment)
279309
EOF
310+
else
311+
IFS='' read -r -d '' text <<EOF
312+
The ‘Summary’ section below captures the configuration of the experiment. No
313+
build scans are available for inspection since publishing was disabled for the
314+
experiment.
315+
316+
$(explain_performance_characteristics)
317+
318+
$(explain_command_to_repeat_experiment)
319+
320+
$(print_summary)
321+
322+
$(print_command_to_repeat_experiment)
323+
324+
$(explain_when_to_rerun_experiment)
325+
EOF
326+
fi
280327
print_interactive_text "${text}"
281328
}
282329

Diff for: components/scripts/gradle/03-validate-local-build-caching-different-locations.sh

+56-8
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,16 @@ execute() {
7373
wizard_execute() {
7474
print_introduction
7575

76-
print_bl
77-
explain_prerequisites_ccud_gradle_plugin "I."
76+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
77+
print_bl
78+
explain_prerequisites_ccud_gradle_plugin "I."
7879

79-
print_bl
80-
explain_prerequisites_api_access "II."
80+
print_bl
81+
explain_prerequisites_api_access "II."
82+
else
83+
print_bl
84+
explain_prerequisites_ccud_gradle_plugin
85+
fi
8186

8287
print_bl
8388
explain_collect_git_details
@@ -146,11 +151,19 @@ execute_build() {
146151
}
147152

148153
print_gradle_command() {
149-
info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
154+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
155+
info "./gradlew --build-cache -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
156+
else
157+
info "./gradlew --build-cache -Dscan.dump -Dscan.tag.${EXP_SCAN_TAG} -Dscan.value.runId=${RUN_ID} clean ${tasks}$(print_extra_args)"
158+
fi
150159
}
151160

152161
fetch_build_cache_metrics() {
153-
process_build_scan_data_online
162+
if [ "$build_scan_publishing_mode" == "on" ]; then
163+
process_build_scan_data_online
164+
else
165+
find_and_read_build_scan_dumps
166+
fi
154167
}
155168

156169
print_introduction() {
@@ -273,7 +286,8 @@ EOF
273286

274287
explain_measure_build_results() {
275288
local text
276-
IFS='' read -r -d '' text <<EOF
289+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
290+
IFS='' read -r -d '' text <<EOF
277291
$(print_separator)
278292
${HEADER_COLOR}Measure build results${RESTORE}
279293
@@ -286,13 +300,30 @@ two builds to assist you in your investigation.
286300
287301
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
288302
EOF
303+
else
304+
IFS='' read -r -d '' text <<EOF
305+
$(print_separator)
306+
${HEADER_COLOR}Measure build results${RESTORE}
307+
308+
Now that the second build has finished successfully, you are ready to measure how
309+
well your build leverages Gradle’s local build caching functionality for the
310+
invoked set of Gradle tasks.
311+
312+
Some of the build scan data will be extracted from the locally stored, intermediate
313+
build data produced by the two builds to assist you in your investigation.
314+
315+
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
316+
EOF
317+
fi
289318
print_interactive_text "${text}"
290319
wait_for_enter
291320
}
292321

293322
explain_and_print_summary() {
294323
local text
295-
IFS='' read -r -d '' text <<EOF
324+
325+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
326+
IFS='' read -r -d '' text <<EOF
296327
The ‘Summary’ section below captures the configuration of the experiment and the
297328
two build scans that were published as part of running the experiment. The build
298329
scan of the second build is particularly interesting since this is where you can
@@ -314,6 +345,23 @@ $(print_command_to_repeat_experiment)
314345
315346
$(explain_when_to_rerun_experiment)
316347
EOF
348+
else
349+
IFS='' read -r -d '' text <<EOF
350+
The ‘Summary’ section below captures the configuration of the experiment. No
351+
build scans are available for inspection since publishing was disabled for the
352+
experiment.
353+
354+
$(explain_performance_characteristics)
355+
356+
$(explain_command_to_repeat_experiment)
357+
358+
$(print_summary)
359+
360+
$(print_command_to_repeat_experiment)
361+
362+
$(explain_when_to_rerun_experiment)
363+
EOF
364+
fi
317365
print_interactive_text "${text}"
318366
}
319367

0 commit comments

Comments
 (0)