From e5719662a91a7eb310eb0ea528992c49090784c9 Mon Sep 17 00:00:00 2001 From: twerth Date: Tue, 14 Aug 2018 00:00:02 -0700 Subject: 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 --- .../devtools/build/lib/rules/proto/SupportData.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/proto/SupportData.java') 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 transitiveProtoPathFlags, String protoSourceRoot, NestedSet directProtoSourceRoots, - boolean hasProtoSources) { + boolean hasProtoSources, + @Nullable NestedSet protosInExports, + @Nullable NestedSet 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 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 getProtosInExports(); + + /** + * The {@code proto_source_root}'s collected from the current library and the exported + * dependencies. + */ + public abstract @Nullable NestedSet getExportedProtoSourceRoots(); + SupportData() {} } -- cgit v1.2.3