Skip to content

Commit 4045b78

Browse files
committed
ci: Run tests with Java 8
1 parent 93460bb commit 4045b78

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.kokoro/nightly/downstream-protobuf-source-compatibility.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
2929
pushd "$repo"
3030

3131
# Compile with Java 11 and run the tests with Java 8
32-
mvn clean compile -T 1C
32+
mvn compile -T 1C
3333

34-
export JAVA_HOME="${JAVA8_HOME}"
35-
export PATH=$JAVA_HOME/bin:$PATH
36-
37-
echo "The Java Version is"
38-
java -version
34+
if [ -n "${JAVA8_HOME}" ]; then
35+
surefire_opt="-Djvm=${JAVA8_HOME}/bin/java"
36+
else
37+
surefire_opt="-Djvm=${JAVA_HOME}/bin/java"
38+
fi
3939

4040
# Compile the Handwritten Library with the Protobuf-Java version to test source compatibility
4141
# Run unit tests to help check for any behavior differences (dependant on coverage)
@@ -48,6 +48,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
4848
-Denforcer.skip \
4949
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
5050
-pl "${google_cloud_java_handwritten_maven_args}" -am \
51+
"${surefire_opt}" \
5152
-T 1C
5253
else
5354
mvn test -B -V -ntp \
@@ -56,6 +57,7 @@ for repo in ${REPOS_UNDER_TEST//,/ }; do # Split on comma
5657
-Dmaven.javadoc.skip \
5758
-Denforcer.skip \
5859
-Dprotobuf.version=${PROTOBUF_RUNTIME_VERSION} \
60+
"${surefire_opt}" \
5961
-T 1C
6062
fi
6163

0 commit comments

Comments
 (0)