aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2018-02-01 15:11:56 -0800
committerGravatar GitHub <noreply@github.com>2018-02-01 15:11:56 -0800
commit5dad7cce19352505f0d93eefed9f170a4d9818fe (patch)
tree7548a2d8d07b1df1cbcdbdcb32af5971e6765280
parent9717d6fa17dd7cb4d9119e46de888e32a24bd5e1 (diff)
parent85b488f7fa12cfe7bfd3c10aecd25aefda734a17 (diff)
Merge pull request #4257 from davido/support_java9
Bazel: Support building with Java 9
-rw-r--r--BUILD16
1 files changed, 15 insertions, 1 deletions
diff --git a/BUILD b/BUILD
index 2902e9e2..b786ff64 100644
--- a/BUILD
+++ b/BUILD
@@ -5,6 +5,17 @@ licenses(["notice"])
exports_files(["LICENSE"])
################################################################################
+# Java 9 configuration
+################################################################################
+
+config_setting(
+ name = "jdk9",
+ values = {
+ "java_toolchain": "@bazel_tools//tools/jdk:toolchain_jdk9",
+ },
+)
+
+################################################################################
# Protobuf Runtime Library
################################################################################
@@ -608,7 +619,10 @@ java_library(
]) + [
":gen_well_known_protos_java",
],
- javacopts = ["-source 7", "-target 7"],
+ javacopts = select({
+ "//:jdk9": ["--add-modules=jdk.unsupported"],
+ "//conditions:default": ["-source 7", "-target 7"],
+ }),
visibility = ["//visibility:public"],
)