@@ -28,10 +28,17 @@ monorepo_handwritten_libraries["grafeas"]="io.grafeas"
2828monorepo_handwritten_libraries[" google-cloud-vertexai" ]=" com.google.cloud"
2929monorepo_handwritten_libraries[" google-cloud-resourcemanager" ]=" com.google.cloud"
3030monorepo_handwritten_libraries[" google-cloud-translate" ]=" com.google.cloud"
31+ # Test a few grpc-* modules as gRPC-Java controls their Protobuf version and may generate code using
32+ # a different version of Protobuf. Not all grpc-* modules are tested as this may build a massive list
33+ # of artifacts. Maven has a limit on the number of arguments it can take (google-cloud-java surpasses that)
34+ monorepo_handwritten_libraries[" grpc-google-cloud-vertexai" ]=" com.google.api.grpc"
35+ monorepo_handwritten_libraries[" grpc-google-cloud-resourcemanager" ]=" com.google.api.grpc"
36+ monorepo_handwritten_libraries[" grpc-google-cloud-translate" ]=" com.google.api.grpc"
3137
3238# 2. These are the mappings of all the downstream handwritten libraries' artifacts
3339declare -A downstream_handwritten_libraries
3440downstream_handwritten_libraries[" google-cloud" ]=" com.google.cloud"
41+ downstream_handwritten_libraries[" grpc-google-cloud" ]=" com.google.api.grpc"
3542
3643# Builds a string output to `artifact_list`. It contains a comma separate list of Maven GAV coordinates. Parses
3744# the `versions.txt` file by searching for the matching artifact_id_prefix to get the corresponding version.
@@ -58,24 +65,6 @@ function build_artifact_list() {
5865 artifact_list=" ${artifact_list} ,${repo_artifact_list} "
5966 fi
6067 fi
61-
62- # grpc-* module are included as gRPC-Java controls their Protobuf version and may generate code
63- # using a different version of Protobuf
64- grpc_repo_artifact_list=$( cat " versions.txt" | grep -E " ^grpc" || true)
65-
66- # Only proceed if there are matching elements
67- if [ -n " ${grpc_repo_artifact_list} " ]; then
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' ' ,' )
69- # Remove the trailing comma after the last entry
70- grpc_repo_artifact_list=${grpc_repo_artifact_list% ,}
71-
72- # The first entry added is not separated with a comma. Avoids generating `,{ARTIFACT_LIST}`
73- if [ -z " ${grpc_artifact_list} " ]; then
74- grpc_artifact_list=" ${grpc_repo_artifact_list} "
75- else
76- grpc_artifact_list=" ${grpc_artifact_list} ,${grpc_repo_artifact_list} "
77- fi
78- fi
7968 done
8069}
8170
@@ -94,7 +83,6 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
9483 mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
9584
9685 artifact_list=" "
97- grpc_artifact_list=" "
9886 if [ " ${repo} " == " google-cloud-java" ]; then
9987 build_artifact_list monorepo_handwritten_libraries
10088 else
@@ -106,8 +94,6 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
10694
10795 echo " Artifact List: ${artifact_list} "
10896 # 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
11197 if [ -n " ${artifact_list} " ]; then
11298 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} "
11399 echo " Running Linkage Checker on the repo's handwritten modules"
@@ -117,15 +103,6 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
117103 echo " Unable to find any matching artifacts to test in ${repo} "
118104 exit 1
119105 fi
120-
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} "
125- echo " Running Linkage Checker on the repo's gRPC modules"
126- echo " Linkage Checker Program Arguments for gRPC Modules: ${program_args} "
127- mvn -B -ntp exec:java -Dexec.args=" ${program_args} " -P exec-linkage-checker
128- fi
129106done
130107popd
131108popd
0 commit comments