aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
diff options
context:
space:
mode:
authorGravatar Chris Parsons <cparsons@google.com>2016-06-15 19:32:34 +0000
committerGravatar Yue Gan <yueg@google.com>2016-06-16 09:01:54 +0000
commitf6a45fda097fcdae4704915c530403a90e9d6745 (patch)
tree54e74a970f2245fdc4517e5a2cc0cb2f9ee43c0e /src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
parent19f2238b608d7ebba182a2bdd405e4696975f733 (diff)
Support for platform_type="watchos" on apple_binary.
This builds all dependencies linked against watch SDKs instead of iOS SDKs, and builds for the architectures specified in --watchos_multi_cpus RELNOTES: apple_binary supports a new platform_type attribute, which, if set to "watchos", will build dependencies for Apple's watchOS2. -- MOS_MIGRATED_REVID=124980029
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
index 47cd99374b..a9edec73a5 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
@@ -201,8 +201,18 @@ public class ObjcRuleClasses {
// retrieving it from the rule context.
static SpawnAction.Builder spawnAppleEnvActionBuilder(RuleContext ruleContext,
Platform targetPlatform) {
- AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class);
-
+ return spawnAppleEnvActionBuilder(
+ ruleContext.getFragment(AppleConfiguration.class), targetPlatform);
+ }
+
+ /**
+ * Creates a new spawn action builder with apple environment variables set that are typically
+ * needed by the apple toolchain. This should be used to start to build spawn actions that, in
+ * order to run, require both a darwin architecture and a collection of environment variables
+ * which contain information about the target and host architectures.
+ */
+ static SpawnAction.Builder spawnAppleEnvActionBuilder(AppleConfiguration appleConfiguration,
+ Platform targetPlatform) {
ImmutableMap.Builder<String, String> envBuilder = ImmutableMap.<String, String>builder()
.putAll(appleConfiguration.getTargetAppleEnvironment(targetPlatform))
.putAll(appleConfiguration.getAppleHostSystemEnv());