diff options
author | 2018-07-26 07:44:33 -0700 | |
---|---|---|
committer | 2018-07-26 07:45:49 -0700 | |
commit | 74146fdbcc4eb0463e64588a764b22e253a405ac (patch) | |
tree | f37bc5ac2ae707274f1bd3fbb4a8f90682980c70 /src/test/java/com/google/devtools/build | |
parent | 676e0cd86b51e37cfa710e456b22853914c1cf0a (diff) |
Add a flag to make Apple rules not share C++ compile actions.
This is accomplished by:
- Setting the APPLE_CROSSTOOL configuration distinguisher in AppleCrosstoolTransition
- Doing nothing in AppleCrosstoolTransition in case we are already in an Apple configuration so that funky use cases like a binary having a dependency on a swift_library both directly and through an objc_library work
- Adding the "apl-" prefix to the output directory name in APPLE_CROSSTOOL configurations
Plus a few minor cleanups:
- Removed some unused methods
- Nopped out --enable_apple_crosstool_transition if the new flag is set
- Nopped out --target_uses_apple_crosstool if the new flag is set
These latter reduce the possible space of Apple configurations, thus making the code a bit more comprehensible.
RELNOTES: None.
PiperOrigin-RevId: 206157413
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java | 4 | ||||
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java index da2d3124b9..0501930cbb 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryTest.java @@ -461,7 +461,7 @@ public class ObjcProtoLibraryTest extends ObjcRuleTestCase { @Test public void testCompilationAction() throws Exception { - useConfiguration("--cpu=ios_i386"); + useConfiguration("--cpu=ios_i386", "--apple_crosstool_in_output_directory_name"); ApplePlatform platform = ApplePlatform.IOS_SIMULATOR; // Because protos are linked/compiled within the apple_binary context, we need to traverse the @@ -510,7 +510,7 @@ public class ObjcProtoLibraryTest extends ObjcRuleTestCase { .addAll( ObjcLibraryTest.iquoteArgs( providerForTarget("//package:opl_binary"), - getTargetConfiguration())) + getAppleCrosstoolConfiguration())) .add("-I") .add(sourceFile.getExecPath().getParentDirectory().getParentDirectory().toString()) .add("-fno-objc-arc") diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java index 4227116991..2090c7642a 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/ObjcRuleTestCase.java @@ -192,6 +192,12 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { switch (configurationDistinguisher) { case UNKNOWN: return String.format("%s-out/ios_%s-%s/", TestConstants.PRODUCT_NAME, arch, modeSegment); + case APPLE_CROSSTOOL: + return String.format("%1$s-out/apl-ios_%2$s%3$s-%4$s/", + TestConstants.PRODUCT_NAME, + arch, + minOsSegment, + modeSegment); case APPLEBIN_IOS: return String.format( "%1$s-out/ios-%2$s%4$s-%3$s-ios_%2$s-%5$s/", @@ -2107,7 +2113,9 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { private void checkCustomModuleMap(RuleType ruleType, boolean targetUnderTestShouldPropagate) throws Exception { useConfiguration( - "--experimental_objc_enable_module_maps", "--incompatible_strict_objc_module_maps"); + "--apple_crosstool_in_output_directory_name", + "--experimental_objc_enable_module_maps", + "--incompatible_strict_objc_module_maps"); ruleType.scratchTarget(scratch, "deps", "['//z:a']"); scratch.file("z/a.m"); scratch.file("z/a.h"); @@ -2139,7 +2147,7 @@ public abstract class ObjcRuleTestCase extends BuildViewTestCase { assertThat(compileActionA.getArguments()).doesNotContain("-fmodule-name"); String x8664Genfiles = - configurationGenfiles("x86_64", ConfigurationDistinguisher.UNKNOWN, null); + configurationGenfiles("x86_64", ConfigurationDistinguisher.APPLE_CROSSTOOL, null); // The target with the module map should propagate it to its direct dependers... ObjcProvider provider = providerForTarget("//z:testModuleMap"); |