java_grpc_library: fix remote protos that are 'src's

'includes' were already handled, but not 'src's. This allows you to
depend on things like :any_proto from the protobuf repo.

Fixes #3650
This commit is contained in:
Eric Anderson 2017-11-06 17:11:34 -08:00
parent f792efe82f
commit 3936557e72
1 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ def _gensource_impl(ctx):
"--grpc-java_out={0},enable_deprecated={1}:{2}" "--grpc-java_out={0},enable_deprecated={1}:{2}"
.format(flavor, str(ctx.attr.enable_deprecated).lower(), srcdotjar.path)] .format(flavor, str(ctx.attr.enable_deprecated).lower(), srcdotjar.path)]
+ ["-I{0}={1}".format(_path_ignoring_repository(include), include.path) for include in includes] + ["-I{0}={1}".format(_path_ignoring_repository(include), include.path) for include in includes]
+ [src.short_path for src in srcs]) + [_path_ignoring_repository(src) for src in srcs])
ctx.action( ctx.action(
command = "cp $1 $2", command = "cp $1 $2",
inputs = [srcdotjar], inputs = [srcdotjar],
@ -45,7 +45,7 @@ _gensource = rule(
"flavor": attr.string( "flavor": attr.string(
values = [ values = [
"normal", "normal",
"lite", # Not currently supported "lite", # Not currently supported
], ],
default = "normal", default = "normal",
), ),