aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java_tools
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-06-15 15:55:34 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-06-16 13:58:46 +0000
commit075b39d85a5e5aaf82a83dc07d2ea7ca7385a47f (patch)
tree7a47e7b72fe1596d6c7bffe84e9e426345b29ffb /src/java_tools
parent65f422376467aa2369e2e1a7bb0ba8fc2e69393b (diff)
Set-up travis OSX to compile using JDK 7
This is introducing a few changes to use the Java compiler from errorprone: - add the --java_langtools flag to the shell tests so we do the tests with the same java compiler tooling than Bazel, and - added the langtools the bootclasspath of the JavaBuilder tests. - tagged some tests and deactivated them on travis OSX because they either requires Java 8 or a lot of disk space. To do the same change on a local install, one must: - change the source and target versions to 7 in the tools/jdk:toolchain target, - use the .travis/jdk7.WORKSPACE file instead of the default Bazel workspace (it contains a maven_jar refering to the errorprone's java compiler tools), and - set the JAVA_VERSION environent variable to "1.7". The .travis/build.sh script does just that when under OS X. -- Change-Id: Idb466cf47cf7df35a34fb0dd8d186628aae0cba7 Reviewed-on: https://bazel-review.googlesource.com/#/c/1520/ MOS_MIGRATED_REVID=96011123
Diffstat (limited to 'src/java_tools')
-rw-r--r--src/java_tools/buildjar/BUILD14
-rw-r--r--src/java_tools/singlejar/BUILD1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/java_tools/buildjar/BUILD b/src/java_tools/buildjar/BUILD
index 5e41759ba1..073272b16a 100644
--- a/src/java_tools/buildjar/BUILD
+++ b/src/java_tools/buildjar/BUILD
@@ -150,13 +150,27 @@ java_library(
deps = [":BazelJavaCompiler"],
)
+# For the -Xbootclasspath option of the java_test of buildjar
+genrule(
+ name = "langtools-test",
+ testonly = 1,
+ srcs = ["//tools/defaults:java_langtools"],
+ outs = ["langtools-test.jar"],
+ cmd = "cp $< $@",
+)
+
java_test(
name = "BazelJavaCompilerTest",
size = "small",
srcs = ["javatests/com/google/devtools/build/java/bazel/BazelJavaCompilerTest.java"],
args = ["com.google.devtools.build.java.bazel.BazelJavaCompilerTest"],
+ jvm_flags = [
+ # Simulates how Bazel invokes JavaBuilder
+ "-Xbootclasspath/p:$${TEST_SRCDIR}/src/java_tools/buildjar/langtools-test.jar",
+ ],
deps = [
":BazelJavaCompiler",
+ ":langtools-test",
"//third_party:guava",
"//third_party:junit4",
"//third_party:truth",
diff --git a/src/java_tools/singlejar/BUILD b/src/java_tools/singlejar/BUILD
index 8d3685c7d2..ac52119e29 100644
--- a/src/java_tools/singlejar/BUILD
+++ b/src/java_tools/singlejar/BUILD
@@ -50,6 +50,7 @@ java_test(
name = "zipTests",
srcs = glob(["javatests/**/zip/**/*.java"]),
args = ["com.google.devtools.build.zip.ZipTests"],
+ tags = ["zip"],
deps = [
":zip",
"//src/test/java:testutil",