forked from rules-proto-grpc/rules_proto_grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
closure_proto_library.bzl
32 lines (29 loc) · 1011 Bytes
/
closure_proto_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
32
load("//closure:closure_proto_compile.bzl", "closure_proto_compile")
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_js_library")
def closure_proto_library(**kwargs):
# Compile protos
name_pb = kwargs.get("name") + "_pb"
closure_proto_compile(
name = name_pb,
**{k: v for (k, v) in kwargs.items() if k in ("deps", "verbose")} # Forward args
)
# Create closure library
closure_js_library(
name = kwargs.get("name"),
srcs = [name_pb],
deps = PROTO_DEPS,
visibility = kwargs.get("visibility"),
tags = kwargs.get("tags"),
suppress = [
"JSC_LATE_PROVIDE_ERROR",
"JSC_UNDEFINED_VARIABLE",
"JSC_IMPLICITLY_NULLABLE_JSDOC",
"JSC_STRICT_INEXISTENT_PROPERTY",
"JSC_POSSIBLE_INEXISTENT_PROPERTY",
"JSC_UNRECOGNIZED_TYPE_ERROR",
"JSC_TYPE_MISMATCH",
],
)
PROTO_DEPS = [
"@io_bazel_rules_closure//closure/protobuf:jspb"
]