diff options
author | 2017-02-08 17:39:07 +0000 | |
---|---|---|
committer | 2017-02-08 17:51:16 +0000 | |
commit | a43dacd3f44019fbfb6cacfb91673cbbdcd8f045 (patch) | |
tree | 6395447193cde99cb240aa3aa8f9b0f763143282 /src/test/java/com/google/devtools/build/lib/rules | |
parent | b1f3302d93b05221ae7b6a50665a9765584b9edd (diff) |
Stop retrieving CcToolChainProvider statically from hard-coded attribute ":cc_toolchain" in RuleContext, instead take the provider from users and pass it around to where it is used.
This gives J2ObjcAspect the ability to specify the C++ toolchain attribute under a different name to avoid attribute conflicts with attached rules that have already declared attribute ":cc_toolchain".
--
PiperOrigin-RevId: 146920294
MOS_MIGRATED_REVID=146920294
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/rules')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java index 75e7cd912b..2157e8673a 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionTest.java @@ -242,7 +242,9 @@ public class CppLinkActionTest extends BuildViewTestCase { public Action generate(int i) throws InterruptedException { CppLinkActionBuilder builder = new CppLinkActionBuilder( - ruleContext, (i & 2) == 0 ? dynamicOutputFile : staticOutputFile) { + ruleContext, + (i & 2) == 0 ? dynamicOutputFile : staticOutputFile, + CppHelper.getToolchain(ruleContext, ":cc_toolchain")) { @Override protected Artifact getInterfaceSoBuilder() { return interfaceSoBuilder; @@ -292,7 +294,9 @@ public class CppLinkActionTest extends BuildViewTestCase { public Action generate(int i) throws InterruptedException { CppLinkActionBuilder builder = new CppLinkActionBuilder( - ruleContext, (i & 2) == 0 ? staticOutputFile : dynamicOutputFile) { + ruleContext, + (i & 2) == 0 ? staticOutputFile : dynamicOutputFile, + CppHelper.getToolchain(ruleContext, ":cc_toolchain")) { @Override protected Artifact getInterfaceSoBuilder() { return interfaceSoBuilder; @@ -320,7 +324,8 @@ public class CppLinkActionTest extends BuildViewTestCase { new PathFragment("output/path.ifso"), getTargetConfiguration().getBinDirectory( RepositoryName.MAIN), ActionsTestUtil.NULL_ARTIFACT_OWNER); - CppLinkActionBuilder builder = new CppLinkActionBuilder(ruleContext, output); + CppLinkActionBuilder builder = new CppLinkActionBuilder( + ruleContext, output, CppHelper.getToolchain(ruleContext, ":cc_toolchain")); builder.setLinkType(LinkTargetType.STATIC_LIBRARY); assertTrue(builder.canSplitCommandLine()); @@ -408,7 +413,7 @@ public class CppLinkActionTest extends BuildViewTestCase { getTargetConfiguration() .getBinDirectory(ruleContext.getRule().getRepository())), ruleContext.getConfiguration(), - CppHelper.getToolchain(ruleContext)) + CppHelper.getToolchain(ruleContext, ":cc_toolchain")) .addObjectFiles(nonLibraryInputs) .addLibraries(NestedSetBuilder.wrap(Order.LINK_ORDER, libraryInputs)) .setLinkType(type) |