aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2016-04-20 13:58:08 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-04-20 14:23:56 +0000
commit0ad9f5e33c845cd5e26ac34b80d3892cce84f710 (patch)
treeb48739f7e14dda53fa91a1ada79855730f7855f5 /compile.sh
parent01e7914245132a07ceb222eb21d1a015b701782d (diff)
Refactor JDK 7 build to use the vendored version of it
Along the path, fix the build for JDK 7 and get rid of most ugliness in the JDK 7 build. Now simply setting JAVA_VERSION to 1.7 will build a JDK 7 compatible version. Fixes #1159. -- Change-Id: I9599283844a57d9e053f12d37445907f22a9232e Reviewed-on: https://bazel-review.googlesource.com/#/c/3452 MOS_MIGRATED_REVID=120332747
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh21
1 files changed, 11 insertions, 10 deletions
diff --git a/compile.sh b/compile.sh
index 56299b8f1b..59ec71c72e 100755
--- a/compile.sh
+++ b/compile.sh
@@ -141,23 +141,24 @@ if [ $DO_TESTS ]; then
fi
[ -n "$JAVAC_VERSION" ] || get_java_version
- if [[ ! "${BAZEL_TEST_FILTERS-}" =~ "-jdk8" ]] \
- && [ "8" -gt ${JAVAC_VERSION#*.} ]; then
- display "$WARNING Your version of Java is lower than 1.8!"
- display "$WARNING Deactivating Java 8 tests, please use a JDK 8 to fully"
- display "$WARNING test Bazel."
- if [ -n "${BAZEL_TEST_FILTERS-}" ]; then
- BAZEL_TEST_FILTERS="${BAZEL_TEST_FILTERS},-jdk8"
- else
- BAZEL_TEST_FILTERS="-jdk8"
+ if [[ ! "${BAZEL_TEST_FILTERS-}" =~ "-jdk8" ]]; then
+ if [ "8" -gt ${JAVAC_VERSION#*.} ] || [ "${JAVA_VERSION}" = "1.7" ]; then
+ display "$WARNING Your version of Java is lower than 1.8!"
+ display "$WARNING Deactivating Java 8 tests, please use a JDK 8 to fully"
+ display "$WARNING test Bazel."
+ if [ -n "${BAZEL_TEST_FILTERS-}" ]; then
+ BAZEL_TEST_FILTERS="${BAZEL_TEST_FILTERS},-jdk8"
+ else
+ BAZEL_TEST_FILTERS="-jdk8"
+ fi
fi
fi
$BAZEL --bazelrc=${BAZELRC} --nomaster_bazelrc test \
--test_tag_filters="${BAZEL_TEST_FILTERS-}" \
--build_tests_only \
--nolegacy_bazel_java_test \
+ --define JAVA_VERSION=${JAVA_VERSION} \
${EXTRA_BAZEL_ARGS} \
- --javacopt="-source ${JAVA_VERSION} -target ${JAVA_VERSION}" \
-k --test_output=errors //src/... //third_party/ijar/... //scripts/... \
|| fail "Tests failed"
fi