From f6a45fda097fcdae4704915c530403a90e9d6745 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Wed, 15 Jun 2016 19:32:34 +0000 Subject: 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 --- .../devtools/build/lib/rules/objc/ObjcRuleClasses.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java') 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 envBuilder = ImmutableMap.builder() .putAll(appleConfiguration.getTargetAppleEnvironment(targetPlatform)) .putAll(appleConfiguration.getAppleHostSystemEnv()); -- cgit v1.2.3