aboutsummaryrefslogtreecommitdiff
path: root/protobuf.bzl
diff options
context:
space:
mode:
authorFahrzin Hemmati <fahhem@appliedintuition.com>2018-03-15 00:37:31 -0700
committerFahrzin Hemmati <fahhem@appliedintuition.com>2018-05-07 15:40:31 -0700
commitae638966e544f5108d566e48cb8edd67d5953f13 (patch)
treec09f31d74fbc247c67576752a9ceaf2eb16d3e93 /protobuf.bzl
parentb3c2ec70733e3945f0c13b8aa21b9060445b3a1f (diff)
downloadprotobuf-ae638966e544f5108d566e48cb8edd67d5953f13.tar.gz
protobuf-ae638966e544f5108d566e48cb8edd67d5953f13.tar.bz2
protobuf-ae638966e544f5108d566e48cb8edd67d5953f13.zip
Track outputs correctly
Diffstat (limited to 'protobuf.bzl')
-rw-r--r--protobuf.bzl7
1 files changed, 5 insertions, 2 deletions
diff --git a/protobuf.bzl b/protobuf.bzl
index 5c4a24d7..ac3e862e 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -93,8 +93,6 @@ def _proto_gen_impl(ctx):
for src in srcs:
args = []
- src_name = src.basename[:-len(".proto")]
- outs = [out for out in ctx.outputs.outs if src_name in out.basename]
in_gen_dir = src.root.path == gen_dir.rstrip('/')
if in_gen_dir:
@@ -103,11 +101,16 @@ def _proto_gen_impl(ctx):
path = f.replace('-I', '')
import_flags_real.append('-I$(realpath -s %s)' % path)
+ outs = []
+ use_grpc_plugin = (ctx.attr.plugin_language == "grpc")
if ctx.attr.gen_cc:
args += ["--cpp_out=$(realpath %s)" % gen_dir]
+ outs.extend(_CcOuts([src.basename], use_grpc_plugin=use_grpc_plugin))
if ctx.attr.gen_py:
args += ["--python_out=$(realpath %s)" % gen_dir]
+ outs.extend(_PyOuts([src.basename], use_grpc_plugin=use_grpc_plugin))
+ outs = [ctx.actions.declare_file(out, sibling=src) for out in outs]
inputs = [src] + deps
if ctx.executable.plugin:
plugin = ctx.executable.plugin