forked from rules-proto-grpc/rules_proto_grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathandroid_grpc_library.bzl
31 lines (28 loc) · 987 Bytes
/
android_grpc_library.bzl
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
load("//android:android_grpc_compile.bzl", "android_grpc_compile")
load("@build_bazel_rules_android//android:rules.bzl", "android_library")
def android_grpc_library(**kwargs):
# Compile protos
name_pb = kwargs.get("name") + "_pb"
android_grpc_compile(
name = name_pb,
**{k: v for (k, v) in kwargs.items() if k in ("deps", "verbose")} # Forward args
)
# Create android library
android_library(
name = kwargs.get("name"),
srcs = [name_pb],
deps = GRPC_DEPS,
exports = GRPC_DEPS,
visibility = kwargs.get("visibility"),
tags = kwargs.get("tags"),
)
GRPC_DEPS = [
"@io_grpc_grpc_java//api",
"@io_grpc_grpc_java//protobuf-lite",
"@io_grpc_grpc_java//stub",
"@io_grpc_grpc_java//stub:javax_annotation",
"@com_google_code_findbugs_jsr305//jar",
"@com_google_guava_guava//jar",
"@com_google_protobuf//:protobuf_javalite",
"@com_google_protobuf//:protobuf_java_util",
]