diff options
author | 2018-07-09 12:16:24 -0700 | |
---|---|---|
committer | 2018-07-09 12:18:00 -0700 | |
commit | e8956648d1c94a3a51e1aba5d229d1f27bdf8e35 (patch) | |
tree | f0549f7f73ceeefc1635e4f2f746da14b096e3ef /src/main/java/com/google/devtools/build/lib/rules/java | |
parent | 68e92b45a37f2142c768a56eb7ecfa484b8b22df (diff) |
[Reland] Accept proto paths relative to proto_source_root as direct dependencies.
This is a reland of https://github.com/bazelbuild/bazel/commit/5deca4cf88f5568771f2c836a9b8c693b88bd749.
This will make protoc see as direct dependencies the .proto files that were included using the proto_source_root flag.
Until now, Bazel passed to protoc the direct dependencies of a target as the path relative to the WORKSPACE, which made it fail when a shorter path, relative to the package was used.
Progress on #4544.
RELNOTES: None.
PiperOrigin-RevId: 203808292
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/java')
3 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaLiteProtoAspect.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaLiteProtoAspect.java index 9e5b521b16..1de36b18e1 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaLiteProtoAspect.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaLiteProtoAspect.java @@ -252,6 +252,7 @@ public class JavaLiteProtoAspect extends NativeAspectClass implements Configured supportData.getTransitiveImports(), supportData.getProtosInDirectDeps(), supportData.getTransitiveProtoPathFlags(), + supportData.getDirectProtoSourceRoots(), ruleContext.getLabel(), ImmutableList.of(sourceJar), "JavaLite", diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoAspect.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoAspect.java index 3c64f91a7d..2df7c12d15 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoAspect.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoAspect.java @@ -281,6 +281,7 @@ public class JavaProtoAspect extends NativeAspectClass implements ConfiguredAspe supportData.getTransitiveImports(), supportData.getProtosInDirectDeps(), supportData.getTransitiveProtoPathFlags(), + supportData.getDirectProtoSourceRoots(), ruleContext.getLabel(), ImmutableList.of(sourceJar), "Java (Immutable)", diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoSkylarkCommon.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoSkylarkCommon.java index cbd866a72f..e658fdf447 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoSkylarkCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JavaProtoSkylarkCommon.java @@ -56,6 +56,7 @@ public class JavaProtoSkylarkCommon supportData.getTransitiveImports(), supportData.getProtosInDirectDeps(), supportData.getTransitiveProtoPathFlags(), + supportData.getDirectProtoSourceRoots(), skylarkRuleContext.getLabel(), ImmutableList.of(sourceJar), "JavaLite", |