diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java index 0663f62af4..a06fa4cedf 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java @@ -19,19 +19,22 @@ import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.syntax.SkylarkCallable; +import com.google.devtools.build.lib.syntax.SkylarkModule; /** * Configured target classes that implement this class can contribute .proto files to the * compilation of proto_library rules. */ @Immutable +@SkylarkModule(name = "ProtoSourcesProvider", doc = "") public final class ProtoSourcesProvider implements TransitiveInfoProvider { - private final NestedSet<Artifact> transitiveImports; private final NestedSet<Artifact> transitiveProtoSources; private final ImmutableList<Artifact> protoSources; - public ProtoSourcesProvider(NestedSet<Artifact> transitiveImports, + public ProtoSourcesProvider( + NestedSet<Artifact> transitiveImports, NestedSet<Artifact> transitiveProtoSources, ImmutableList<Artifact> protoSources) { this.transitiveImports = transitiveImports; @@ -44,6 +47,7 @@ public final class ProtoSourcesProvider implements TransitiveInfoProvider { * This determines the order of "-I" arguments to the protocol compiler, and * that is probably important */ + @SkylarkCallable(name = "transitive_imports", doc = "", structField = true) public NestedSet<Artifact> getTransitiveImports() { return transitiveImports; } @@ -52,6 +56,7 @@ public final class ProtoSourcesProvider implements TransitiveInfoProvider { * Returns the proto sources for this rule and all its dependent protocol * buffer rules. */ + @SkylarkCallable(name = "transitive_proto_sources", doc = "", structField = true) public NestedSet<Artifact> getTransitiveProtoSources() { return transitiveProtoSources; } @@ -60,6 +65,7 @@ public final class ProtoSourcesProvider implements TransitiveInfoProvider { * Returns the proto sources from the 'srcs' attribute. If the library is a proxy library * that has no sources, return the sources from the direct deps. */ + @SkylarkCallable(name = "proto_sources", doc = "", structField = true) public ImmutableList<Artifact> getProtoSources() { return protoSources; } |