@@ -65,14 +65,12 @@ function build_artifact_list() {
65
65
66
66
# Only proceed if there are matching elements
67
67
if [ -n " ${grpc_repo_artifact_list} " ]; then
68
- # Exclude any matches to BOM artifacts or emulators. The repo artifact list will look like:
69
- # "com.google.cloud:google-cloud-accessapproval:2.60.0-SNAPSHOT,com.google.cloud:google-cloud-aiplatform:3.60.0-SNAPSHOT,"
70
- grpc_repo_artifact_list=$( echo " ${grpc_repo_artifact_list} " | awk -F: " {\$ 1=\" ${group_id} :\"\$ 1; \$ 2=\"\" ; print}" OFS=: | sed ' s/::/:/' | tr ' \n' ' ,' )
68
+ grpc_repo_artifact_list=$( echo " ${grpc_repo_artifact_list} " | awk -F: " {\$ 1=\" com.google.api.grpc:\"\$ 1; \$ 2=\"\" ; print}" OFS=: | sed ' s/::/:/' | tr ' \n' ' ,' )
71
69
# Remove the trailing comma after the last entry
72
70
grpc_repo_artifact_list=${grpc_repo_artifact_list% ,}
73
71
74
72
# The first entry added is not separated with a comma. Avoids generating `,{ARTIFACT_LIST}`
75
- if [ -z " ${artifact_list } " ]; then
73
+ if [ -z " ${grpc_artifact_list } " ]; then
76
74
grpc_artifact_list=" ${grpc_repo_artifact_list} "
77
75
else
78
76
grpc_artifact_list=" ${grpc_artifact_list} ,${grpc_repo_artifact_list} "
@@ -107,24 +105,26 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
107
105
popd
108
106
109
107
echo " Artifact List: ${artifact_list} "
110
- # Only run Linkage Checker if the repo has any relevant artifacts to test for
111
- if [ -n " ${artifact_list} " ] || [ -n " ${grpc_artifact_list} " ]; then
112
- # The `-s` argument filters the linkage check problems that stem from the artifact
113
- # There are two calls to Linkage Checker: 1. repo's handwritten modules 2. repo's gRPC modules
114
- # This is because mvn has a limit on the number of program arguments you can pass in
115
-
108
+ # The `-s` argument filters the linkage check problems that stem from the artifact
109
+ # There are two calls to Linkage Checker: 1. repo's handwritten modules 2. repo's gRPC modules
110
+ # This is because mvn has a limit on the number of program arguments you can pass in
111
+ if [ -n " ${artifact_list} " ]; then
116
112
program_args=" -r --artifacts ${artifact_list} ,com.google.protobuf:protobuf-java:${PROTOBUF_RUNTIME_VERSION} ,com.google.protobuf:protobuf-java-util:${PROTOBUF_RUNTIME_VERSION} -s ${artifact_list} "
117
113
echo " Running Linkage Checker on the repo's handwritten modules"
118
114
echo " Linkage Checker Program Arguments: ${program_args} "
119
115
mvn -B -ntp exec:java -Dexec.args=" ${program_args} " -P exec-linkage-checker
116
+ else
117
+ echo " Unable to find any matching artifacts to test in ${repo} "
118
+ exit 1
119
+ fi
120
120
121
- program_args=" -r --artifacts ${artifact_list} ,com.google.protobuf:protobuf-java:${PROTOBUF_RUNTIME_VERSION} ,com.google.protobuf:protobuf-java-util:${PROTOBUF_RUNTIME_VERSION} -s ${grpc_artifact_list} "
121
+ echo " gRPC Artifact List: ${grpc_artifact_list} "
122
+ # Some downstream handwritten artifacts do not have gRPC support, do not fail if there are no artifacts
123
+ if [ -n " ${grpc_artifact_list} " ]; then
124
+ program_args=" -r --artifacts ${grpc_artifact_list} ,com.google.protobuf:protobuf-java:${PROTOBUF_RUNTIME_VERSION} ,com.google.protobuf:protobuf-java-util:${PROTOBUF_RUNTIME_VERSION} -s ${grpc_artifact_list} "
122
125
echo " Running Linkage Checker on the repo's gRPC modules"
123
126
echo " Linkage Checker Program Arguments for gRPC Modules: ${program_args} "
124
127
mvn -B -ntp exec:java -Dexec.args=" ${program_args} " -P exec-linkage-checker
125
- else
126
- echo " Unable to find any matching artifacts to test in ${repo} "
127
- exit 1
128
128
fi
129
129
done
130
130
popd
0 commit comments