Skylark: Make ctx.var a dictionary.
ctx.var(x) is kept for compatibility and should be removed after next
release.
--
MOS_MIGRATED_REVID=88438195
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java
index 900f901..5d2bafd 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Package.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java
@@ -452,6 +452,17 @@
}
/**
+ * Returns all make variables for a given platform.
+ */
+ public Map<String, String> getAllMakeVariables(String platform) {
+ ImmutableMap.Builder<String, String> map = ImmutableMap.builder();
+ for (String var : makeEnv.getBindings().keySet()) {
+ map.put(var, makeEnv.lookup(var, platform));
+ }
+ return map.build();
+ }
+
+ /**
* Returns the label of this package's BUILD file.
*
* Typically <code>getBuildFileLabel().getName().equals("BUILD")</code> --