diff options
author | elenairina <elenairina@google.com> | 2018-02-20 06:26:33 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-20 06:27:57 -0800 |
commit | 5deca4cf88f5568771f2c836a9b8c693b88bd749 (patch) | |
tree | 1ab038e4bf10301e0e8878c21e9693091b78e304 /src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java | |
parent | 9ac10696da052d1327b3f1cd276b2ab50fe1fee1 (diff) |
Accept proto paths relative to proto_source_root as direct dependencies.
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: 186294997
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java b/src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java index 9e02d190d5..ad2c09c3ee 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java @@ -34,10 +34,11 @@ public abstract class SupportData { NestedSet<Artifact> protosInDirectDeps, NestedSet<Artifact> transitiveImports, NestedSet<String> transitiveProtoPathFlags, + NestedSet<String> directProtoSourceRoots, boolean hasProtoSources) { return new AutoValue_SupportData( nonWeakDepsPredicate, protoSources, transitiveImports, protosInDirectDeps, - transitiveProtoPathFlags, hasProtoSources); + transitiveProtoPathFlags, directProtoSourceRoots, hasProtoSources); } public abstract Predicate<TransitiveInfoCollection> getNonWeakDepsPredicate(); @@ -57,6 +58,11 @@ public abstract class SupportData { */ public abstract NestedSet<String> getTransitiveProtoPathFlags(); + /** + * The {@code proto_source_root}'s collected from the current library and the direct dependencies. + */ + public abstract NestedSet<String> getDirectProtoSourceRoots(); + public abstract boolean hasProtoSources(); SupportData() {} |