aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar Chris Parsons <cparsons@google.com>2016-08-22 18:23:43 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2016-08-23 09:29:14 +0000
commit4dd1187b3bd31d6838917a8d8b492f9cd992eaf7 (patch)
tree887dcdf424f8cdcecd0c7b9ec24965e7acea671a /src/main
parent0b48ab671c41ce1f58d3ad2cc2dcdabb0aeda8d7 (diff)
Expose single and multi-architecture platform retrieval methods (AppleConfiguration) to skylark.
-- MOS_MIGRATED_REVID=130960948
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java
index 740f5c00bf..712def6f81 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java
@@ -309,6 +309,9 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
* architecture (such as in {@code objc_library}, which registers single-architecture compile
* actions).
*/
+ @SkylarkCallable(name = "single_arch_platform", doc = "The platform of the current"
+ + " configuration. This should only be invoked in a context where only a single architecture"
+ + " may be supported; consider mutli_arch_platform for other cases.")
public Platform getSingleArchPlatform() {
return Platform.forTarget(applePlatformType, getSingleArchitecture());
}
@@ -321,6 +324,9 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
* Otherwise, this will return a simulator platform.
*/
// TODO(bazel-team): This should support returning multiple platforms.
+ @SkylarkCallable(name = "multi_arch_platform", doc = "The platform of the current configuration "
+ + "for the given platform type. This should only be invoked in a context where multiple "
+ + "architectures may be supported; consider single_arch_platform for other cases.")
public Platform getMultiArchPlatform(PlatformType platformType) {
List<String> architectures = getMultiArchitectures(platformType);
switch (platformType) {