From 36ff24cca3e3e1bd09422bef646d98621b1270e4 Mon Sep 17 00:00:00 2001 From: Chris Parsons Date: Tue, 2 Aug 2016 18:48:43 +0000 Subject: Introduce apple_watch2_extension rule for bundling watchOS2 extensions. This can be used in conjunction with apple_binary to add watchOS2 extensions to an ios application bundle. This is the majority of the native work for this bundling logic. Before announcing general availability of this feature, we will want to: 1. Iterate with teams who have existing watchOS2 apps to catch any corner-case bugs 2. Introduce a skylark macro to wrap apple_watch2_extension and apple_binary into a single rule; this will both serve as a convenience and ensure users set the appropriate linkopts and platformtype on their apple_binary target. -- MOS_MIGRATED_REVID=129122855 --- .../build/lib/rules/objc/IosApplicationRule.java | 35 +++++++++++++--------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/IosApplicationRule.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplicationRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplicationRule.java index c7a0a2bb26..e299f3aacf 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplicationRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IosApplicationRule.java @@ -51,23 +51,30 @@ public class IosApplicationRule implements RuleDefinition { /* The binary target included in the final bundle. */ - .add(attr("binary", LABEL) - .allowedRuleClasses("objc_binary") - .allowedFileTypes() - .mandatory() - .direct_compile_time_input() - .cfg(IosApplication.SPLIT_ARCH_TRANSITION)) + .add( + attr("binary", LABEL) + .allowedRuleClasses("objc_binary") + .allowedFileTypes() + .mandatory() + .direct_compile_time_input() + .cfg(IosApplication.SPLIT_ARCH_TRANSITION)) /* Any extensions to include in the final application. */ - .add(attr("extensions", LABEL_LIST) - .allowedRuleClasses("ios_extension", "apple_watch1_extension") - .allowedFileTypes() - .direct_compile_time_input()) - .add(attr("$runner_script_template", LABEL).cfg(HOST) - .value(env.getToolsLabel("//tools/objc:ios_runner.sh.mac_template"))) - .add(attr("$is_executable", BOOLEAN).value(true) - .nonconfigurable("Called from RunCommand.isExecutable, which takes a Target")) + .add( + attr("extensions", LABEL_LIST) + .allowedRuleClasses( + "ios_extension", "apple_watch1_extension", "apple_watch2_extension") + .allowedFileTypes() + .direct_compile_time_input()) + .add( + attr("$runner_script_template", LABEL) + .cfg(HOST) + .value(env.getToolsLabel("//tools/objc:ios_runner.sh.mac_template"))) + .add( + attr("$is_executable", BOOLEAN) + .value(true) + .nonconfigurable("Called from RunCommand.isExecutable, which takes a Target")) .build(); } -- cgit v1.2.3