aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2017-03-07 16:40:41 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-03-07 17:14:57 +0000
commitd72bc57b60b26245e64f5ccafe023a5ede81cc7f (patch)
treebc5c3eb9a32a3bd750212d3b8fdb158710fb2d57
parent17e2033e34074e8b8de8944e79783f05092762ab (diff)
Select the good guava jars for JDK7 build
Manually tested with ./compile.sh and JAVA_VERSION=1.7 Fixes #2644. -- PiperOrigin-RevId: 149422627 MOS_MIGRATED_REVID=149422627
-rwxr-xr-xscripts/bootstrap/compile.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index ec7156937d..dee6ce2b5b 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -17,10 +17,17 @@
# Script for building bazel from scratch without bazel
PROTO_FILES=$(ls src/main/protobuf/*.proto src/main/java/com/google/devtools/build/lib/buildeventstream/proto/*.proto)
-LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -ve third_party/grpc/grpc.*jar | tr "\n" " ")
+LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve third_party/grpc/grpc.*jar | tr "\n" " ")
GRPC_JAVA_VERSION=0.15.0
GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e .*${GRPC_JAVA_VERSION}.*jar | tr "\n" " ")
-LIBRARY_JARS="${LIBRARY_JARS} ${GRPC_LIBRARY_JARS}"
+# Guava jars are different for JDK 7 build and JDK 8 build, we select the good
+# one based on the name (21.0-{date} for JDK7).
+if [ "${JAVA_VERSION}" = "1.7" ]; then
+ GUAVA_JARS=third_party/guava/guava-*21.0-*.jar
+else
+ GUAVA_JARS=third_party/guava/guava-*21.0.jar
+fi
+LIBRARY_JARS="${LIBRARY_JARS} ${GRPC_LIBRARY_JARS} ${GUAVA_JARS}"
# tl;dr - error_prone_core contains a copy of an older version of guava, so we
# need to make sure the newer version of guava always appears first on the