Fix bazel BUILD for Java.

pull/1169/head
Ming Zhao 9 years ago
parent 187977649b
commit 4fe03816b1
  1. 16
      BUILD

16
BUILD

@ -459,19 +459,23 @@ cc_test(
# Java support # Java support
################################################################################ ################################################################################
genrule( genrule(
name = "generate_java_descriptor_proto", name = "gen_well_known_protos_java",
srcs = ["src/google/protobuf/descriptor.proto"], srcs = WELL_KNOWN_PROTOS,
outs = ["com/google/protobuf/DescriptorProtos.java"], outs = [
cmd = "$(location :protoc) --java_out=$(@D)/../../.. $<", "wellknown.srcjar"
],
cmd = "$(location :protoc) --java_out=$(@D)/wellknown.jar" +
" -Isrc $(SRCS) " +
" && mv $(@D)/wellknown.jar $(@D)/wellknown.srcjar",
tools = [":protoc"], tools = [":protoc"],
) )
java_library( java_library(
name = "protobuf_java", name = "protobuf_java",
srcs = glob([ srcs = glob([
"java/src/main/java/com/google/protobuf/*.java", "java/core/src/main/java/com/google/protobuf/*.java",
]) + [ ]) + [
":generate_java_descriptor_proto", ":gen_well_known_protos_java",
], ],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )

Loading…
Cancel
Save