|
|
@ -89,13 +89,13 @@ def _proto_gen_impl(ctx): |
|
|
|
if source_dir: |
|
|
|
if source_dir: |
|
|
|
has_sources = any([src.is_source for src in srcs]) |
|
|
|
has_sources = any([src.is_source for src in srcs]) |
|
|
|
if has_sources: |
|
|
|
if has_sources: |
|
|
|
import_flags += ["-I" + source_dir] |
|
|
|
import_flags.append("-I" + source_dir) |
|
|
|
else: |
|
|
|
else: |
|
|
|
import_flags += ["-I."] |
|
|
|
import_flags.append("-I.") |
|
|
|
|
|
|
|
|
|
|
|
has_generated = any([not src.is_source for src in srcs]) |
|
|
|
has_generated = any([not src.is_source for src in srcs]) |
|
|
|
if has_generated: |
|
|
|
if has_generated: |
|
|
|
import_flags += ["-I" + gen_dir] |
|
|
|
import_flags.append("-I" + gen_dir) |
|
|
|
|
|
|
|
|
|
|
|
if ctx.attr.includes: |
|
|
|
if ctx.attr.includes: |
|
|
|
for include in ctx.attr.includes: |
|
|
|
for include in ctx.attr.includes: |
|
|
@ -103,7 +103,7 @@ def _proto_gen_impl(ctx): |
|
|
|
# This is effectively source_dir, which has already been handled, |
|
|
|
# This is effectively source_dir, which has already been handled, |
|
|
|
# and may be generated incorrectly here. |
|
|
|
# and may be generated incorrectly here. |
|
|
|
continue |
|
|
|
continue |
|
|
|
import_flags += ["-I" + _GetPath(ctx, include)] |
|
|
|
import_flags.append("-I" + _GetPath(ctx, include)) |
|
|
|
|
|
|
|
|
|
|
|
import_flags = depset(direct = import_flags) |
|
|
|
import_flags = depset(direct = import_flags) |
|
|
|
|
|
|
|
|
|
|
@ -160,7 +160,7 @@ def _proto_gen_impl(ctx): |
|
|
|
outs.extend(_RubyOuts([src.basename])) |
|
|
|
outs.extend(_RubyOuts([src.basename])) |
|
|
|
|
|
|
|
|
|
|
|
# Otherwise, rely on user-supplied outs. |
|
|
|
# Otherwise, rely on user-supplied outs. |
|
|
|
args += [("--%s_out=" + path_tpl) % (lang, gen_dir)] |
|
|
|
args.append(("--%s_out=" + path_tpl) % (lang, gen_dir)) |
|
|
|
|
|
|
|
|
|
|
|
if ctx.attr.outs: |
|
|
|
if ctx.attr.outs: |
|
|
|
outs.extend(ctx.attr.outs) |
|
|
|
outs.extend(ctx.attr.outs) |
|
|
@ -181,8 +181,8 @@ def _proto_gen_impl(ctx): |
|
|
|
|
|
|
|
|
|
|
|
if ctx.attr.plugin_options: |
|
|
|
if ctx.attr.plugin_options: |
|
|
|
outdir = ",".join(ctx.attr.plugin_options) + ":" + outdir |
|
|
|
outdir = ",".join(ctx.attr.plugin_options) + ":" + outdir |
|
|
|
args += [("--plugin=protoc-gen-%s=" + path_tpl) % (lang, plugin.path)] |
|
|
|
args.append(("--plugin=protoc-gen-%s=" + path_tpl) % (lang, plugin.path)) |
|
|
|
args += ["--%s_out=%s" % (lang, outdir)] |
|
|
|
args.append("--%s_out=%s" % (lang, outdir)) |
|
|
|
tools.append(plugin) |
|
|
|
tools.append(plugin) |
|
|
|
|
|
|
|
|
|
|
|
if not in_gen_dir: |
|
|
|
if not in_gen_dir: |
|
|
|