From 140f0a97487602139146e9013de2a7f184e56758 Mon Sep 17 00:00:00 2001 From: David Santiago Date: Mon, 4 May 2015 15:11:01 +0000 Subject: Move the "families" attribute to BundlingRule. Currently the "families" attribute is defined on the ReleaseBundlingRule. Due to the relationships between the iOS rule classes, this leaves some rules that need to know the device family they are building for without that knowledge. Specifically, objc_bundle_library() can build storyboards outside of any app or extension, and thus needs to know the target device families to use during compilation. For reference, this was discussed at https://groups.google.com/d/msg/bazel-discuss/c-2nwFiqhWo/puESbFNGAYMJ This commit moves the "families" attribute from ReleaseBundlingRule to BundlingRule to accomplish this. -- Change-Id: Ia0d146e85f1c2cdb13bd74aef4a57de1ad537e0f MOS_MIGRATED_REVID=92725861 --- .../build/lib/rules/objc/ObjcRuleClasses.java | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') 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 0180fbccf6..e038039b73 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 @@ -809,6 +809,16 @@ public class ObjcRuleClasses { */ .add(attr("infoplist", LABEL) .allowedFileTypes(PLIST_TYPE)) + /* + The device families to which this bundle or binary is targeted. + ${SYNOPSIS} + + This is known as the TARGETED_DEVICE_FAMILY build setting + in Xcode project files. It is a list of one or more of the strings + "iphone" and "ipad". + */ + .add(attr("families", STRING_LIST) + .value(ImmutableList.of(TargetDeviceFamily.IPHONE.getNameInRule()))) .add(attr("$momczip_deploy", LABEL).cfg(HOST) .value(env.getLabel("//tools/objc:momczip_deploy.jar"))) .build(); @@ -914,16 +924,6 @@ public class ObjcRuleClasses { return "example." + rule.getName(); } })) - /* - The device families to which this binary is targeted. - ${SYNOPSIS} - - This is known as the TARGETED_DEVICE_FAMILY build setting - in Xcode project files. It is a list of one or more of the strings - "iphone" and "ipad". - */ - .add(attr("families", STRING_LIST) - .value(ImmutableList.of(TargetDeviceFamily.IPHONE.getNameInRule()))) .add(attr("$bundlemerge", LABEL).cfg(HOST).exec() .value(env.getLabel("//tools/objc:bundlemerge"))) .build(); -- cgit v1.2.3