Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ostrovsky2017-12-13 22:41:45 +0000
committerMatthias Sohn2018-02-07 22:51:35 +0000
commitab1b97234ded461407b163b178a592cdabe66930 (patch)
tree20e1fe34e3ae39e691dc9c4a7f787c759e00965b /org.eclipse.jgit/BUILD
parent6766fc85d06464402168e71e27a506eb2042b279 (diff)
downloadjgit-ab1b97234ded461407b163b178a592cdabe66930.tar.gz
jgit-ab1b97234ded461407b163b178a592cdabe66930.tar.xz
jgit-ab1b97234ded461407b163b178a592cdabe66930.zip
Bazel: Support building with Java 9
Bazel@HEAD supports Java 9. The current code has one single issue with Java 9 compliance: the usage of javax.xml.bind.DatatypeConverter class for printHexBinary() method. This class is not available on Java 9. One alternative is to use guava library. Something similar was done here: [1]. But unlike the case with checkstyle library, JGit currently doesn't use guava. Instead, we add java.xml.bind module with --add-modules compiler option. To build (or test) with Java 9, build custom bazel version and issue: $ bazel --host_javabase=/usr/lib64/jvm/java-9-openjdk build \ --javacopt='--release 9' \ --java_toolchain=@bazel_tools//tools/jdk:toolchain_jdk9 :all The Java 9 support is backwards compatible. * [1] https://github.com/checkstyle/checkstyle/issues/5027 Change-Id: I2c5203fc4e65885ce7b210f824fda85ba6d6c51d Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Diffstat (limited to 'org.eclipse.jgit/BUILD')
-rw-r--r--org.eclipse.jgit/BUILD4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.jgit/BUILD b/org.eclipse.jgit/BUILD
index 60c4d3793b..6ba7796b7e 100644
--- a/org.eclipse.jgit/BUILD
+++ b/org.eclipse.jgit/BUILD
@@ -14,6 +14,10 @@ RESOURCES = glob(["resources/**"])
java_library(
name = "jgit",
srcs = SRCS,
+ javacopts = select({
+ "//:jdk9": ["--add-modules=java.xml.bind"],
+ "//conditions:default": [],
+ }),
resource_strip_prefix = "org.eclipse.jgit/resources",
resources = RESOURCES,
deps = [

Back to the top