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.
pull/4380/head
Mateusz Matejczyk 7 years ago committed by GitHub
parent 8e44a86fac
commit 294b5758c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      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:

Loading…
Cancel
Save