Merge pull request #4257 from davido/support_java9

Bazel: Support building with Java 9
This commit is contained in:
Feng Xiao 2018-02-01 15:11:56 -08:00 committed by GitHub
commit 5dad7cce19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
BUILD
View File

@ -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
################################################################################
@ -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"],
)