1515
1616set -eo pipefail
1717
18- # There are three Env Vars that this script uses.
19- # 1. (Required) REPOS_UNDER_TEST: Comma separate list of the repo names
20- # 2. (Required) PROTOBUF_RUNTIME_VERSION: Protobuf runtime version to test again
21- # 3. REPOS_INSTALLED_LOCALLY: Flag (if set to "true) will determine if the repo
22- # needs to be cloned from github and re-installed locally to the m2. If the artifact
23- # is already installed locally, this saves time as the artifact is not again compiled
24- # and built.
25-
2618# Comma-delimited list of repos to test with the local java-shared-dependencies
2719if [ -z " ${REPOS_UNDER_TEST} " ]; then
2820 echo " REPOS_UNDER_TEST must be set to run downstream-protobuf-binary-compatibility.sh"
@@ -85,18 +77,11 @@ mvn -B -ntp clean compile -T 1C
8577pushd dependencies
8678
8779for repo in ${REPOS_UNDER_TEST// ,/ } ; do # Split on comma
88- if [ " ${REPOS_INSTALLED_LOCALLY} " != " true" ]; then
89- # Perform testing on main (with latest changes). Shallow copy as history is not important
90- git clone " https://github.com/googleapis/${repo} .git" --depth=1
91- pushd " ${repo} "
92- # Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
93- mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
94- else
95- # If installed locally to .m2, then just pull the versions.txt file to parse
96- mkdir -p " ../../${repo} "
97- pushd " ../../${repo} "
98- curl -Os " https://raw.githubusercontent.com/googleapis/${repo} /refs/heads/main/versions.txt"
99- fi
80+ # Perform testing on main (with latest changes). Shallow copy as history is not important
81+ git clone " https://github.com/googleapis/${repo} .git" --depth=1
82+ pushd " ${repo} "
83+ # Install all repo modules to ~/.m2 (there can be multiple relevant artifacts to test i.e. core, admin, control)
84+ mvn -B -ntp install -T 1C -DskipTests -Dclirr.skip -Denforcer.skip
10085
10186 artifact_list=" "
10287 if [ " ${repo} " == " google-cloud-java" ]; then
@@ -114,7 +99,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
11499 # The `-s` argument filters the linkage check problems that stem from the artifact
115100 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} "
116101 echo " Linkage Checker Program Arguments: ${program_args} "
117- mvn -B -ntp exec:java -Dexec.mainClass= " com.google.cloud.tools.opensource.classpath.LinkageCheckerMain " -Dexec. args=" ${program_args} " -P exec-linkage-checker
102+ mvn -B -ntp exec:java -Dexec.args=" ${program_args} " -P exec-linkage-checker
118103 fi
119104 echo " done"
120105done
0 commit comments