Skip to content

Commit c4e0465

Browse files
committed
Adjust interactive text accordingly
1 parent 6e03824 commit c4e0465

File tree

1 file changed

+56
-10
lines changed

1 file changed

+56
-10
lines changed

components/scripts/maven/02-validate-local-build-caching-different-locations.sh

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@ wizard_execute() {
7474
print_bl
7575
print_introduction
7676

77-
print_bl
78-
explain_prerequisites_ccud_maven_extension "I."
79-
80-
print_bl
81-
explain_prerequisites_api_access "II."
77+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
78+
print_bl
79+
explain_prerequisites_ccud_maven_extension "I."
80+
print_bl
81+
explain_prerequisites_api_access "II."
82+
else
83+
print_bl
84+
explain_prerequisites_ccud_maven_extension
85+
fi
8286

8387
print_bl
8488
explain_collect_git_details
@@ -300,7 +304,8 @@ EOF
300304

301305
explain_measure_build_results() {
302306
local text
303-
IFS='' read -r -d '' text <<EOF
307+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
308+
IFS='' read -r -d '' text <<EOF
304309
$(print_separator)
305310
${HEADER_COLOR}Measure build results${RESTORE}
306311
@@ -313,22 +318,36 @@ two builds to assist you in your investigation.
313318
314319
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
315320
EOF
321+
else
322+
IFS='' read -r -d '' text <<EOF
323+
$(print_separator)
324+
${HEADER_COLOR}Measure build results${RESTORE}
325+
326+
Now that the second build has finished successfully, you are ready to measure in
327+
Gradle Enterprise how well your build leverages the local build cache for
328+
the invoked set of Maven goals.
329+
330+
Some of the build scan data will be extracted from the locally stored, intermediate
331+
build data produced by the two builds to assist you in your investigation.
332+
333+
${USER_ACTION_COLOR}Press <Enter> to measure the build results.${RESTORE}
334+
EOF
335+
fi
316336
print_wizard_text "${text}"
317337
wait_for_enter
318338
}
319339

320340
explain_and_print_summary() {
321341
read_build_scan_metadata
322342
local text
323-
IFS='' read -r -d '' text <<EOF
343+
if [[ "${build_scan_publishing_mode}" == "on" ]]; then
344+
IFS='' read -r -d '' text <<EOF
324345
The ‘Summary’ section below captures the configuration of the experiment and the
325346
two build scans that were published as part of running the experiment. The build
326347
scan of the second build is particularly interesting since this is where you can
327348
inspect what goals were not leveraging the local build cache.
328349
329-
The ‘Build Caching Leverage’ section below reveals the realized and potential
330-
savings from build caching. All cacheable goals' outputs need to be taken from
331-
the build cache in the second build for the build to be fully cacheable.
350+
$(explain_build_cache_leverage)
332351
333352
The ‘Investigation Quick Links’ section below allows quick navigation to the
334353
most relevant views in build scans to investigate what goals were avoided due to
@@ -344,8 +363,35 @@ $(print_command_to_repeat_experiment)
344363
345364
$(explain_when_to_rerun_experiment)
346365
EOF
366+
else
367+
IFS='' read -r -d '' text <<EOF
368+
The ‘Summary’ section below captures the configuration of the experiment. No
369+
build scans are available for inspection since publishing was disabled for the
370+
experiment.
371+
372+
$(explain_build_cache_leverage)
373+
374+
$(explain_command_to_repeat_experiment)
375+
376+
$(print_summary)
377+
378+
$(print_command_to_repeat_experiment)
379+
380+
$(explain_when_to_rerun_experiment)
381+
EOF
382+
fi
347383
print_wizard_text "${text}"
348384
}
349385

386+
explain_build_cache_leverage() {
387+
local text
388+
IFS='' read -r -d '' text <<EOF
389+
The ‘Build Caching Leverage’ section below reveals the realized and potential
390+
savings from build caching. All cacheable goals' outputs need to be taken from
391+
the build cache in the second build for the build to be fully cacheable.
392+
EOF
393+
echo -n "${text}"
394+
}
395+
350396
process_arguments "$@"
351397
main

0 commit comments

Comments
 (0)