aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Daniel Wagner-Hall <danielwh@google.com>2015-06-16 22:24:19 +0000
committerGravatar John Field <jfield@google.com>2015-06-17 15:24:03 +0000
commitb9ec66aa5e37657e0952f5f6c284e75ea75560cf (patch)
tree2931ea45ebc3e78e7c9491550c29c1c8cddae71f /src
parentd132af88fb301c2ef5439b0d7ba77027a9554178 (diff)
ios_test: Default xctest to 1 not 0
-- MOS_MIGRATED_REVID=96149626
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java77
1 files changed, 41 insertions, 36 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 bd2ecc6566..fb5b1ea13c 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
@@ -752,44 +752,49 @@ public class ObjcRuleClasses {
public RuleClass build(Builder builder, final RuleDefinitionEnvironment env) {
return builder
/* <!-- #BLAZE_RULE($ios_test_base_rule).ATTRIBUTE(target_device) -->
- The device against which to run the test.
- ${SYNOPSIS}
- <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
- .add(attr(IosTest.TARGET_DEVICE, LABEL)
- .allowedFileTypes()
- .allowedRuleClasses("ios_device"))
+ The device against which to run the test.
+ ${SYNOPSIS}
+ <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
+ .add(
+ attr(IosTest.TARGET_DEVICE, LABEL)
+ .allowedFileTypes()
+ .allowedRuleClasses("ios_device"))
/* <!-- #BLAZE_RULE($ios_test_base_rule).ATTRIBUTE(xctest) -->
- Whether this target contains tests using the XCTest testing framework.
- ${SYNOPSIS}
- <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
- .add(attr(IosTest.IS_XCTEST, BOOLEAN))
+ Whether this target contains tests using the XCTest testing framework.
+ ${SYNOPSIS}
+ <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
+ .add(attr(IosTest.IS_XCTEST, BOOLEAN).value(true))
/* <!-- #BLAZE_RULE($ios_test_base_rule).ATTRIBUTE(xctest_app) -->
- A <code>objc_binary</code> target that contains the app bundle to test against in XCTest.
- This attribute is only valid if <code>xctest</code> is true.
- ${SYNOPSIS}
- <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
- .add(attr(IosTest.XCTEST_APP, LABEL)
- .value(new Attribute.ComputedDefault(IosTest.IS_XCTEST) {
- @Override
- public Object getDefault(AttributeMap rule) {
- return rule.get(IosTest.IS_XCTEST, Type.BOOLEAN)
- ? env.getLabel("//tools/objc:xctest_app")
- : null;
- }
- })
- .allowedFileTypes()
- // TODO(bazel-team): Remove objc_binary once it stops exporting XcTestAppProvider.
- .allowedRuleClasses("objc_binary", "ios_application"))
- .override(attr("infoplist", LABEL)
- .value(new Attribute.ComputedDefault(IosTest.IS_XCTEST) {
- @Override
- public Object getDefault(AttributeMap rule) {
- return rule.get(IosTest.IS_XCTEST, Type.BOOLEAN)
- ? env.getLabel("//tools/objc:xctest_infoplist")
- : null;
- }
- })
- .allowedFileTypes(PLIST_TYPE))
+ A <code>objc_binary</code> target that contains the app bundle to test against in XCTest.
+ This attribute is only valid if <code>xctest</code> is true.
+ ${SYNOPSIS}
+ <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
+ .add(
+ attr(IosTest.XCTEST_APP, LABEL)
+ .value(
+ new Attribute.ComputedDefault(IosTest.IS_XCTEST) {
+ @Override
+ public Object getDefault(AttributeMap rule) {
+ return rule.get(IosTest.IS_XCTEST, Type.BOOLEAN)
+ ? env.getLabel("//tools/objc:xctest_app")
+ : null;
+ }
+ })
+ .allowedFileTypes()
+ // TODO(bazel-team): Remove objc_binary once it stops exporting XcTestAppProvider.
+ .allowedRuleClasses("objc_binary", "ios_application"))
+ .override(
+ attr("infoplist", LABEL)
+ .value(
+ new Attribute.ComputedDefault(IosTest.IS_XCTEST) {
+ @Override
+ public Object getDefault(AttributeMap rule) {
+ return rule.get(IosTest.IS_XCTEST, Type.BOOLEAN)
+ ? env.getLabel("//tools/objc:xctest_infoplist")
+ : null;
+ }
+ })
+ .allowedFileTypes(PLIST_TYPE))
.build();
}
@Override