diff options
author | twerth <twerth@google.com> | 2018-08-14 00:00:02 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-08-14 00:01:58 -0700 |
commit | e5719662a91a7eb310eb0ea528992c49090784c9 (patch) | |
tree | 3a7ec7df05198ce8acca7700d5d4dd5cdd51bb61 /src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java | |
parent | 1f253d2a1a44bd53910e26a891e1ef88301e934d (diff) |
Add exports attribute to proto_library.
Note that it is currently only used by the java_proto_library family of rules (if enabled per flag).
RELNOTES: None
PiperOrigin-RevId: 208601730
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 | 18 |
1 files changed, 16 insertions, 2 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 b3644d4c17..35c0cee485 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 @@ -22,6 +22,7 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; +import javax.annotation.Nullable; /** A helper class for the *Support classes containing some data from ProtoLibrary. */ @AutoCodec @@ -37,7 +38,9 @@ public abstract class SupportData { NestedSet<String> transitiveProtoPathFlags, String protoSourceRoot, NestedSet<String> directProtoSourceRoots, - boolean hasProtoSources) { + boolean hasProtoSources, + @Nullable NestedSet<Artifact> protosInExports, + @Nullable NestedSet<String> exportedProtoSourceRoots) { return new AutoValue_SupportData( nonWeakDepsPredicate, directProtoSources, @@ -46,7 +49,9 @@ public abstract class SupportData { transitiveProtoPathFlags, protoSourceRoot, directProtoSourceRoots, - hasProtoSources); + hasProtoSources, + protosInExports, + exportedProtoSourceRoots); } public abstract Predicate<TransitiveInfoCollection> getNonWeakDepsPredicate(); @@ -76,5 +81,14 @@ public abstract class SupportData { public abstract boolean hasProtoSources(); + /** .proto files in the exported dependencies of this proto_library. */ + public abstract @Nullable NestedSet<Artifact> getProtosInExports(); + + /** + * The {@code proto_source_root}'s collected from the current library and the exported + * dependencies. + */ + public abstract @Nullable NestedSet<String> getExportedProtoSourceRoots(); + SupportData() {} } |