diff options
author | stone4774 <25053818+stone4774@users.noreply.github.com> | 2018-03-22 11:16:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 11:16:34 +0800 |
commit | c99f5278eb8dad6f42def88ce8b5a3453f6df4a8 (patch) | |
tree | c3cd284ec9d2981f61da266d040935b73275b5c4 /protobuf.bzl | |
parent | d053271deebe0efcd41729991b1f3d618b638ad5 (diff) | |
parent | ed4321d1cb33199984118d801956822842771e7e (diff) | |
download | protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.tar.gz protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.tar.bz2 protobuf-c99f5278eb8dad6f42def88ce8b5a3453f6df4a8.zip |
Merge branch 'master' into fixbug_enum2json2
Diffstat (limited to 'protobuf.bzl')
-rw-r--r-- | protobuf.bzl | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/protobuf.bzl b/protobuf.bzl index 6aed44a4..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: @@ -171,10 +174,10 @@ def cc_proto_library( deps=[], cc_libs=[], include=None, - protoc="//:protoc", + protoc="@com_google_protobuf//:protoc", internal_bootstrap_hack=False, use_grpc_plugin=False, - default_runtime="//:protobuf", + default_runtime="@com_google_protobuf//:protobuf", **kargs): """Bazel rule to create a C++ protobuf library from proto source files @@ -317,8 +320,8 @@ def py_proto_library( py_libs=[], py_extra_srcs=[], include=None, - default_runtime="//:protobuf_python", - protoc="//:protoc", + default_runtime="@com_google_protobuf//:protobuf_python", + protoc="@com_google_protobuf//:protoc", use_grpc_plugin=False, **kargs): """Bazel rule to create a Python protobuf library from proto source files @@ -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: |