Skip to content

Commit

Permalink
Merge pull request protocolbuffers#4257 from davido/support_java9
Browse files Browse the repository at this point in the history
Bazel: Support building with Java 9
  • Loading branch information
xfxyjwf authored Feb 1, 2018
2 parents 7a725d2 + bed1762 commit 0e53886
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,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
################################################################################
Expand Down Expand Up @@ -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"],
)

Expand Down

0 comments on commit 0e53886

Please sign in to comment.