aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/BaseRuleClasses.java17
1 files changed, 15 insertions, 2 deletions
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 2e5c1d56c9..aa45dba3a1 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
@@ -92,6 +92,17 @@ public class BaseRuleClasses {
(rule, attributes, configuration) -> configuration.getCoverageSupport());
}
+ public static final String DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE =
+ "//tools/test:coverage_report_generator";
+
+ public static LabelLateBoundDefault<TestConfiguration> coverageReportGeneratorAttribute(
+ Label defaultValue) {
+ return LabelLateBoundDefault.fromTargetConfiguration(
+ TestConfiguration.class,
+ defaultValue,
+ (rule, attributes, configuration) -> configuration.getCoverageReportGenerator());
+ }
+
// TODO(b/65746853): provide a way to do this without passing the entire configuration
/** Implementation for the :run_under attribute. */
@AutoCodec
@@ -167,9 +178,11 @@ public class BaseRuleClasses {
coverageSupportAttribute(env.getToolsLabel(DEFAULT_COVERAGE_SUPPORT_VALUE))))
// Used in the one-per-build coverage report generation action.
.add(
- attr("$coverage_report_generator", LABEL)
+ attr(":coverage_report_generator", LABEL)
.cfg(HostTransition.INSTANCE)
- .value(env.getLabel("//tools/defaults:coverage_report_generator"))
+ .value(
+ coverageReportGeneratorAttribute(
+ env.getToolsLabel(DEFAULT_COVERAGE_REPORT_GENERATOR_VALUE)))
.singleArtifact())
// The target itself and run_under both run on the same machine. We use the DATA config