forked from rules-proto-grpc/rules_proto_grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
46 lines (42 loc) · 1.57 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
load("//:defs.bzl", "proto_plugin")
load("//android:defs.bzl", "android_proto_compile")
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
proto_plugin(
name = "javalite_plugin",
out = "{name}.jar",
options = ["lite"],
protoc_plugin_name = "java",
visibility = ["//visibility:public"],
)
proto_plugin(
name = "grpc_javalite_plugin",
out = "{name}_grpc.jar",
options = ["lite"],
tool = "@io_grpc_grpc_java//compiler:grpc_java_plugin",
visibility = ["//visibility:public"],
)
# Lite is missing gen_well_known_protos_java from protobuf, compile them manually
# https://github.com/protocolbuffers/protobuf/blob/d16bf914bc5ba569d2b70376051d15f68ce4322d/java/core/BUILD#L94-L112
android_proto_compile(
name = "well_known_protos_srcs",
protos = [
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:api_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:field_mask_proto",
"@com_google_protobuf//:source_context_proto",
"@com_google_protobuf//:struct_proto",
"@com_google_protobuf//:timestamp_proto",
"@com_google_protobuf//:type_proto",
"@com_google_protobuf//:wrappers_proto",
],
)
android_library(
name = "well_known_protos",
srcs = ["well_known_protos_srcs"],
visibility = ["//visibility:public"],
exports = ["@com_google_protobuf//:protobuf_javalite"],
deps = ["@com_google_protobuf//:protobuf_javalite"],
)