Enables the propagation of the XcodeVersionProperties provider for reading from Skylark.
--
PiperOrigin-RevId: 141912220
MOS_MIGRATED_REVID=141912220
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 879a1bb..202be7b 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 @@
}
/**
+ * 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.
*/