Merge pull request #837 from mzhaom/bazel-java

Add "java_proto" target in bazel BUILD file to provide Java runtime library.
This commit is contained in:
Jisi Liu 2015-10-05 13:55:25 -07:00
commit 9cafa20122

23
BUILD
View File

@ -252,6 +252,28 @@ cc_binary(
deps = [":protoc_lib"],
)
################################################################################
# Java support
################################################################################
genrule(
name = "generate_java_descriptor_proto",
tools = [":protoc"],
srcs = [ "src/google/protobuf/descriptor.proto", ],
outs = [ "com/google/protobuf/DescriptorProtos.java" ],
cmd = "$(location :protoc) --java_out=$(@D)/../../.. $<",
)
java_library(
name = "java_proto",
visibility = ["//visibility:public"],
srcs = glob([
"java/src/main/java/com/google/protobuf/*.java"
]) + [
":generate_java_descriptor_proto",
]
)
################################################################################
# Tests
################################################################################
@ -429,4 +451,3 @@ cc_test(
"//external:gtest_main",
],
)