From ae638966e544f5108d566e48cb8edd67d5953f13 Mon Sep 17 00:00:00 2001 From: Fahrzin Hemmati Date: Thu, 15 Mar 2018 00:37:31 -0700 Subject: Track outputs correctly --- protobuf.bzl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'protobuf.bzl') 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 -- cgit v1.2.3