aboutsummaryrefslogtreecommitdiff
path: root/protobuf.bzl
diff options
context:
space:
mode:
authorMateusz Matejczyk <mateusz.matejczyk@gmail.com>2018-03-11 17:48:10 -0400
committerGitHub <noreply@github.com>2018-03-11 17:48:10 -0400
commit294b5758c373cbab4b72f35f4cb62dc1d8332b68 (patch)
treedce3a04cff5a7338862eb49f3c7177ff4d2eafa9 /protobuf.bzl
parent8e44a86facd0f42af7a3c0c47f8133f78f037269 (diff)
downloadprotobuf-294b5758c373cbab4b72f35f4cb62dc1d8332b68.tar.gz
protobuf-294b5758c373cbab4b72f35f4cb62dc1d8332b68.tar.bz2
protobuf-294b5758c373cbab4b72f35f4cb62dc1d8332b68.zip
Output *_pb2_grpc.py when use_grpc_plugin=True
Start outputting missing *_pb2_grpc.py files when use_grpc_plugin is set to True for py_proto_library.
Diffstat (limited to 'protobuf.bzl')
-rw-r--r--protobuf.bzl9
1 files changed, 6 insertions, 3 deletions
diff --git a/protobuf.bzl b/protobuf.bzl
index 1c2d63c6..78f19c62 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -45,8 +45,11 @@ def _CcSrcs(srcs, use_grpc_plugin=False):
def _CcOuts(srcs, use_grpc_plugin=False):
return _CcHdrs(srcs, use_grpc_plugin) + _CcSrcs(srcs, use_grpc_plugin)
-def _PyOuts(srcs):
- return [s[:-len(".proto")] + "_pb2.py" for s in srcs]
+def _PyOuts(srcs, use_grpc_plugin=False):
+ ret = [s[:-len(".proto")] + "_pb2.py" for s in srcs]
+ if use_grpc_plugin:
+ ret += [s[:-len(".proto")] + "_pb2_grpc.py" for s in srcs]
+ return ret
def _RelativeOutputPath(path, include, dest=""):
if include == None:
@@ -344,7 +347,7 @@ def py_proto_library(
**kargs: other keyword arguments that are passed to cc_library.
"""
- outs = _PyOuts(srcs)
+ outs = _PyOuts(srcs, use_grpc_plugin)
includes = []
if include != None: