aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis
diff options
context:
space:
mode:
authorGravatar Sergio Campama <kaipi@google.com>2016-12-13 18:49:28 +0000
committerGravatar John Cater <jcater@google.com>2016-12-13 21:05:01 +0000
commite8cecd90c5bf8c064654600a7412e6287b16dfff (patch)
tree409ad58ccef8abd6978af27994d72ee9c2cd8fc1 /src/main/java/com/google/devtools/build/lib/analysis
parent2f31d60d1454cd324196a5159262c1ba32eabda8 (diff)
Enables the propagation of the XcodeVersionProperties provider for reading from Skylark.
-- PiperOrigin-RevId: 141912220 MOS_MIGRATED_REVID=141912220
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
index 879a1bbe18..202be7b633 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -849,6 +849,18 @@ public final class RuleContext extends TargetContext
}
/**
+ * Returns the declared provider (native and Skylark) for the specified constructor under the
+ * specified attribute of this target in the BUILD file. May return null if there is no
+ * TransitiveInfoCollection under the specified attribute.
+ */
+ @Nullable
+ public SkylarkClassObject getPrerequisite(
+ String attributeName, Mode mode, final SkylarkClassObjectConstructor.Key skylarkKey) {
+ TransitiveInfoCollection prerequisite = getPrerequisite(attributeName, mode);
+ return prerequisite == null ? null : prerequisite.get(skylarkKey);
+ }
+
+ /**
* Returns all the providers of the specified type that are listed under the specified attribute
* of this target in the BUILD file, and that contain the specified provider.
*/