aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
diff options
context:
space:
mode:
authorGravatar Ulf Adams <ulfjack@google.com>2015-08-31 12:32:14 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-08-31 19:13:45 +0000
commitfc154ae77180544ec3bcac19b7a86ad091d6526e (patch)
tree865c4d4fbadabf36f9c00e9418b5fad2d9318fe2 /src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
parenta1d93965eca2d7a7c1afca79a85d9e546f22096f (diff)
Drop the baseline artifact output group.
The baseline artifacts are part of the instrumented files provider now, and are strongly tied to the collect_code_coverage flag. It seems to be simpler to collect them explicitly in the BuildView (which already collects them for post-processing), than to rely on the output group selection. -- MOS_MIGRATED_REVID=101926341
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/BuildView.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/BuildView.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
index 55f0456618..b27c2f362f 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/BuildView.java
@@ -64,6 +64,7 @@ import com.google.devtools.build.lib.pkgcache.LoadingPhaseRunner.LoadingResult;
import com.google.devtools.build.lib.pkgcache.PackageManager;
import com.google.devtools.build.lib.rules.test.CoverageReportActionFactory;
import com.google.devtools.build.lib.rules.test.CoverageReportActionFactory.CoverageReportActionsWrapper;
+import com.google.devtools.build.lib.rules.test.InstrumentedFilesProvider;
import com.google.devtools.build.lib.skyframe.ActionLookupValue;
import com.google.devtools.build.lib.skyframe.AspectValue;
import com.google.devtools.build.lib.skyframe.AspectValue.AspectKey;
@@ -690,17 +691,23 @@ public class BuildView {
Set<Artifact> artifactsToBuild = new HashSet<>();
Set<ConfiguredTarget> parallelTests = new HashSet<>();
Set<ConfiguredTarget> exclusiveTests = new HashSet<>();
- Collection<Artifact> buildInfoArtifacts;
- buildInfoArtifacts = skyframeExecutor.getWorkspaceStatusArtifacts();
+
// build-info and build-changelist.
+ Collection<Artifact> buildInfoArtifacts = skyframeExecutor.getWorkspaceStatusArtifacts();
Preconditions.checkState(buildInfoArtifacts.size() == 2, buildInfoArtifacts);
artifactsToBuild.addAll(buildInfoArtifacts);
+
+ // Extra actions
addExtraActionsIfRequested(viewOptions, artifactsToBuild, configuredTargets);
+
+ // Coverage
+ NestedSet<Artifact> baselineCoverageArtifacts = getBaselineCoverageArtifacts(configuredTargets);
+ Iterables.addAll(artifactsToBuild, baselineCoverageArtifacts);
if (coverageReportActionFactory != null) {
CoverageReportActionsWrapper actionsWrapper;
actionsWrapper = coverageReportActionFactory.createCoverageReportActionsWrapper(
allTargetsToTest,
- getBaselineCoverageArtifacts(configuredTargets),
+ baselineCoverageArtifacts,
artifactFactory,
CoverageReportValue.ARTIFACT_OWNER);
if (actionsWrapper != null) {
@@ -710,7 +717,7 @@ public class BuildView {
}
}
- // Note that this must come last, so that the tests are scheduled after all artifacts are built.
+ // Tests. This must come last, so that the exclusive tests are scheduled after everything else.
scheduleTestsIfRequested(parallelTests, exclusiveTests, topLevelOptions, allTargetsToTest);
String error = !loadingResult.hasLoadingError()
@@ -748,11 +755,9 @@ public class BuildView {
Collection<ConfiguredTarget> configuredTargets) {
NestedSetBuilder<Artifact> baselineCoverageArtifacts = NestedSetBuilder.stableOrder();
for (ConfiguredTarget target : configuredTargets) {
- OutputGroupProvider provider = target.getProvider(OutputGroupProvider.class);
+ InstrumentedFilesProvider provider = target.getProvider(InstrumentedFilesProvider.class);
if (provider != null) {
- baselineCoverageArtifacts.addTransitive(provider.getOutputGroup(
- OutputGroupProvider.BASELINE_COVERAGE
- ));
+ baselineCoverageArtifacts.addTransitive(provider.getBaselineCoverageArtifacts());
}
}
return baselineCoverageArtifacts.build();