aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
diff options
context:
space:
mode:
authorGravatar elenairina <elenairina@google.com>2017-09-27 12:13:52 -0400
committerGravatar John Cater <jcater@google.com>2017-09-28 08:54:31 -0400
commitaeb21bc2b61d89e8e1cd79da6194a651d9f50610 (patch)
tree16d8f2b128fb476dab16ac86f6dbf7c33977c83f /src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
parent41b29027a8d4c85eae0d44eca93dc5f4a090cfce (diff)
Add required/advertised Skylark providers.
This is needed to advertise and request JavaInfo (a native declared provider) instead of JavaCompilationArgsProvider. RELNOTES: None. PiperOrigin-RevId: 170205997
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
index 5570c3f913..a028e71a71 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AspectDefinition.java
@@ -291,6 +291,15 @@ public final class AspectDefinition {
requiredProviders.addNativeSet(ImmutableSet.copyOf(providers));
return this;
}
+
+ /**
+ * Asserts that this aspect can only be evaluated for rules that supply all of the specified
+ * Skylark providers.
+ */
+ public Builder requireSkylarkProviders(SkylarkProviderIdentifier... skylarkProviders) {
+ requiredProviders.addSkylarkSet(ImmutableSet.copyOf(skylarkProviders));
+ return this;
+ }
public Builder requireAspectsWithProviders(
Iterable<ImmutableSet<SkylarkProviderIdentifier>> providerSets) {