From 8f460f399123709d5b07c68184147ab024e1c593 Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Wed, 29 Jun 2016 09:14:10 +0000 Subject: Refactor how coverage support files get to test actions. Previously we used labels in each configuration fragment that then got added to every test action. Instead, we now have a filegroup under //tools/test for coverage files that truly need to be on the inputs of every test action and collect language-specific support files in InstrumentedFilesProvider. This makes configuration creation simpler and makes it possible to turn --crosstool_top into something else other than a filegroup (previously, it was that filegroup that got added to every test action) -- MOS_MIGRATED_REVID=126170241 --- .../build/lib/analysis/BaseRuleClasses.java | 61 +++------------- .../lib/analysis/OutputFileConfiguredTarget.java | 6 ++ .../lib/analysis/config/BuildConfiguration.java | 82 ++++++---------------- .../build/lib/rules/SkylarkRuleClassFunctions.java | 72 ++++--------------- .../devtools/build/lib/rules/cpp/CcCommon.java | 1 + .../build/lib/rules/cpp/CppConfiguration.java | 8 --- .../devtools/build/lib/rules/cpp/CppHelper.java | 9 +++ .../devtools/build/lib/rules/java/JavaCommon.java | 8 ++- .../build/lib/rules/objc/CompilationSupport.java | 11 +++ .../devtools/build/lib/rules/objc/IosTest.java | 4 +- .../devtools/build/lib/rules/objc/IosTestRule.java | 22 +----- .../devtools/build/lib/rules/objc/TestSupport.java | 2 +- .../lib/rules/test/InstrumentedFilesCollector.java | 16 +++-- .../lib/rules/test/InstrumentedFilesProvider.java | 8 +++ .../rules/test/InstrumentedFilesProviderImpl.java | 11 ++- .../build/lib/rules/test/TestActionBuilder.java | 22 +++--- 16 files changed, 126 insertions(+), 217 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java index 031325e121..e43c609149 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java @@ -51,13 +51,6 @@ import java.util.List; * Rule class definitions used by (almost) every rule. */ public class BaseRuleClasses { - /** - * Label of the pseudo-filegroup that contains all the targets that are needed - * for running tests in coverage mode. - */ - private static final Label COVERAGE_SUPPORT_LABEL = - Label.parseAbsoluteUnchecked("//tools/defaults:coverage"); - private static final Attribute.ComputedDefault testonlyDefault = new Attribute.ComputedDefault() { @Override @@ -91,43 +84,10 @@ public class BaseRuleClasses { } }; - private static final LateBoundLabelList COVERAGE_SUPPORT = - new LateBoundLabelList(ImmutableList.of(COVERAGE_SUPPORT_LABEL)) { - @Override - public List