diff options
author | 2015-09-15 07:38:26 +0000 | |
---|---|---|
committer | 2015-09-15 20:26:46 +0000 | |
commit | 9c5deb64da0d92b0223a0f37d6beed5b22ba6417 (patch) | |
tree | 981f5f0a1afac69fc0478e9b58fe460ada9c0ffc /scripts/ci/build.sh | |
parent | 73b6c795b179ffd95eb9bef030dc89585a3b394e (diff) |
Requires JDK 8
This change deprecate JDK 7 as JavaBuilder follow changes in Java 9
and might use Java 8 features. We will maintain a build with the
JDK 7 as long as possible but this build won't include updates
in JavaBuilder.
RELNOTES[INC]: Bazel requires JDK 8 to run.
--
MOS_MIGRATED_REVID=103069207
Diffstat (limited to 'scripts/ci/build.sh')
-rwxr-xr-x | scripts/ci/build.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh index 8e766d59e3..4711287dab 100755 --- a/scripts/ci/build.sh +++ b/scripts/ci/build.sh @@ -97,6 +97,23 @@ EOF fi fi } + +# Set the various arguments when JDK 7 is required (deprecated). +# This method is here to continue to build binary release of Bazel +# for JDK 7. We will drop this method and JDK 7 support when our +# ci system turn red on this one. +function setup_jdk7() { + # This is a JDK 7 JavaBuilder from release 0.1.0. + local javabuilder_url="https://storage.googleapis.com/bazel/0.1.0/JavaBuilder_deploy.jar" + sed -i.bak 's/_version = "8"/_version = "7"/' tools/jdk/BUILD + rm -f tools/jdk/BUILD.bak + curl -s -o tools/jdk/JavaBuilder_deploy.jar "${javabuilder_url}" + export BAZEL_ARGS="--singlejar_top=//src/java_tools/singlejar:bootstrap_deploy.jar \ + --genclass_top=//src/java_tools/buildjar:bootstrap_genclass_deploy.jar \ + --ijar_top=//third_party/ijar" + export BAZEL_SKIP_TOOL_COMPILATION=tools/jdk/JavaBuilder_deploy.jar +} + # Main entry point for building bazel. # It sets the embed label to the release name if any, calls the whole # test suite, compile the various packages, then copy the artifacts @@ -104,10 +121,17 @@ EOF function bazel_build() { local release_label="$(get_full_release_name)" local embed_label_opts= - setup_android_repositories + if [ -n "${release_label}" ]; then export EMBED_LABEL="${release_label}" fi + + if [[ "${JAVA_VERSION-}" =~ ^(1\.)?7$ ]]; then + setup_jdk7 + release_label="${release_label}-jdk7" + fi + + setup_android_repositories ${BUILD_SCRIPT_PATH} ${BAZEL_COMPILE_TARGET:-all} || exit $? # Build the packages |