forked from stackb/rules_proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rust_grpc_library.bzl
35 lines (30 loc) · 919 Bytes
/
rust_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
32
33
34
35
load("//rust:rust_grpc_compile.bzl", "rust_grpc_compile")
load("//rust:rust_proto_lib.bzl", "rust_proto_lib")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")
def rust_grpc_library(**kwargs):
name = kwargs.get("name")
deps = kwargs.get("deps")
visibility = kwargs.get("visibility")
name_pb = name + "_pb"
name_lib = name + "_lib"
rust_grpc_compile(
name = name_pb,
deps = deps,
transitive = True,
visibility = visibility,
)
rust_proto_lib(
name = name_lib,
compilation = name_pb,
)
rust_library(
name = name,
srcs = [name_pb, name_lib],
deps = [
str(Label("//rust/cargo:protobuf")),
str(Label("//rust/cargo:grpc")),
str(Label("//rust/cargo:tls_api")),
str(Label("//rust/cargo:tls_api_stub")),
],
visibility = visibility,
)