forked from slizb/min-tfs-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serving.bzl
48 lines (44 loc) · 1.59 KB
/
serving.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
36
37
38
39
40
41
42
43
44
45
46
47
48
load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library")
load("@com_google_protobuf//:protobuf.bzl", "py_proto_library")
def serving_proto_library(
name,
srcs = [],
has_services = False, # pylint: disable=unused-argument
deps = [],
visibility = None,
testonly = 0,
cc_grpc_version = None,
cc_api_version = 2): # pylint: disable=unused-argument
native.filegroup(
name = name + "_proto_srcs",
srcs = srcs,
testonly = testonly,
)
use_grpc_plugin = None
if cc_grpc_version:
use_grpc_plugin = True
cc_proto_library(
name = name,
srcs = srcs,
deps = deps,
cc_libs = ["@com_google_protobuf//:protobuf"],
protoc = "@com_google_protobuf//:protoc",
default_runtime = "@com_google_protobuf//:protobuf",
use_grpc_plugin = use_grpc_plugin,
testonly = testonly,
visibility = visibility,
)
def serving_go_grpc_library(**kwargs): # pylint: disable=unused-argument
"""Build the Go gRPC bindings for a service. Not yet implemented."""
return
def serving_proto_library_py(name, proto_library, srcs = [], deps = [], visibility = None, testonly = 0): # pylint: disable=unused-argument
py_proto_library(
name = name,
srcs = srcs,
srcs_version = "PY2AND3",
deps = ["@com_google_protobuf//:protobuf_python"] + deps,
default_runtime = "@com_google_protobuf//:protobuf_python",
protoc = "@com_google_protobuf//:protoc",
visibility = visibility,
testonly = testonly,
)