Fix Bazel JDK 7 build
Once and for all, I tested it and re-tested should
be good.
--
MOS_MIGRATED_REVID=120381352
diff --git a/scripts/bootstrap/bootstrap.sh b/scripts/bootstrap/bootstrap.sh
index 8732d98..d567b0d 100755
--- a/scripts/bootstrap/bootstrap.sh
+++ b/scripts/bootstrap/bootstrap.sh
@@ -82,12 +82,15 @@
local BAZEL_BIN=$1
local BAZEL_SUM=$2
local BAZEL_TARGET=${3:-src:bazel}
+ local STRATEGY="--strategy=Javac=worker --worker_quit_after_build"
+ if [ "${JAVA_VERSION}" = "1.7" ]; then
+ STRATEGY=
+ fi
[ -x "${BAZEL_BIN}" ] || fail "syntax: bootstrap bazel-binary"
run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} clean \
--expunge || return $?
run ${BAZEL_BIN} --nomaster_bazelrc --bazelrc=${BAZELRC} build \
- ${EXTRA_BAZEL_ARGS-} \
- --strategy=Javac=worker --worker_quit_after_build \
+ ${EXTRA_BAZEL_ARGS-} ${STRATEGY} \
--fetch --nostamp \
--define "JAVA_VERSION=${JAVA_VERSION}" \
--javacopt="-source ${JAVA_VERSION} -target ${JAVA_VERSION}" \
diff --git a/src/create_embedded_tools.sh b/src/create_embedded_tools.sh
index 8de4837..ffbb89c 100755
--- a/src/create_embedded_tools.sh
+++ b/src/create_embedded_tools.sh
@@ -30,7 +30,8 @@
case "$i" in
*tools/jdk/BUILD*) OUTPUT_PATH=tools/jdk/BUILD ;;
*JavaBuilder*_deploy.jar) OUTPUT_PATH=tools/jdk/JavaBuilder_deploy.jar ;;
- *javac*.jar) OUTPUT_PATH=third_party/java/jdk/langtools/javac.jar ;;
+ *javac.jar) OUTPUT_PATH=third_party/java/jdk/langtools/javac.jar ;;
+ *javac7.jar) OUTPUT_PATH=third_party/java/jdk/langtools/javac7.jar ;;
*SingleJar_deploy.jar) OUTPUT_PATH=tools/jdk/SingleJar_deploy.jar ;;
*GenClass_deploy.jar) OUTPUT_PATH=tools/jdk/GenClass_deploy.jar ;;
*Runner_deploy.jar) OUTPUT_PATH=tools/jdk/TestRunner_deploy.jar ;;
@@ -49,6 +50,11 @@
cp "$i" "${PACKAGE_DIR}/${OUTPUT_PATH}"
done
+if [ ! -f ${PACKAGE_DIR}/third_party/java/jdk/langtools/javac.jar ]; then
+ cp ${PACKAGE_DIR}/third_party/java/jdk/langtools/javac7.jar \
+ ${PACKAGE_DIR}/third_party/java/jdk/langtools/javac.jar
+fi
+
cat > "${PACKAGE_DIR}/WORKSPACE" <<EOF
workspace(name = "bazel_tools")
EOF