aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Laurent Le Brun <laurentlb@google.com>2015-05-22 14:00:36 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-05-22 20:00:23 +0000
commitc2a1dcef6f696c910ea0c74b58d968fa08793ebe (patch)
tree989f59cbf11cc1ce4595a1906977a6c8d6410383 /src
parent9ba067d6533f6802c36453045372e4e97b5c3cd9 (diff)
Expose Proto providers to Skylark for experimentation.
Providers are still experimental, we'll document them properly later. -- MOS_MIGRATED_REVID=94274960
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/proto/ProtoSourcesProvider.java10
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;
}