Skip to content

Commit a54e480

Browse files
committed
chore: document the --relative flag
1 parent a4d8af1 commit a54e480

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.kokoro/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ case ${JOB_TYPE} in
200200
if [ -n "${BASE_SHA}" ] && [ -n "${HEAD_SHA}" ]; then
201201
# Optimize the build by identifying ONLY the Maven modules that contain changed Java source files.
202202
# Format those specific modules instead of the entire codebase, reducing format check time.
203+
# The --relative flag is when building in the submodule as only files modified in the module
204+
# should be accounted for.
203205
changed_file_list=$(git diff --name-only "${BASE_SHA}" "${HEAD_SHA}" --relative)
204206
echo "${changed_file_list}"
205207

@@ -232,11 +234,10 @@ case ${JOB_TYPE} in
232234
done
233235
if [ -f "${dir}/pom.xml" ] && [ "${dir}" != "." ]; then
234236
# Filter out directories not participating in the default formatting reactor:
235-
# - samples/tutorials are wrapped in the include-samples profile
236-
# - proto-*/grpc-* are generated code and should not be formatted manually
237+
# - samples are handwritten by developers
238+
# - proto-*/grpc-* are generated code and should use the compiler format
237239
# - *-bom/parents are POM-only and contain no Java source
238240
if [[ "${dir}" != *"samples"* ]] && \
239-
[[ "${dir}" != *"tutorials"* ]] && \
240241
[[ "$(basename "${dir}")" != "proto-google-"* ]] && \
241242
[[ "$(basename "${dir}")" != "grpc-google-"* ]] && \
242243
[[ "$(basename "${dir}")" != *"-bom" ]] && \
@@ -251,7 +252,7 @@ case ${JOB_TYPE} in
251252

252253
echo "Changed Modules: ${changed_modules[*]}"
253254

254-
# Deduplicate the modules using sort -u, so that we pass a concise list of unique modules
255+
# Deduplicate the modules using sort -u to pass a concise list of unique modules
255256
# via the Maven `-pl` argument.
256257
if [ ${#changed_modules[@]} -gt 0 ]; then
257258
unique_modules=$(printf '%s\n' "${changed_modules[@]}" | sort -u | paste -sd ',' -)

0 commit comments

Comments
 (0)