aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-02-19 13:36:06 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-02-19 13:36:06 +0000
commit6916be2eede250ac166c1525a823417982b67818 (patch)
tree2cbeee538bb17b8c515c284c8eccab3afbd4ed8f /src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java
parentbfcb7f340d5b9967bb381e27eb78728fae2ddada (diff)
Remove BaselineCoverageArtifactsProvider in favor of an output group.
The only slightly different thing here is that now, instead of using target.getConfiguration().isCodeCoverageEnabled() we use BuildRequest.Options.collectCodeCoverage, but the only place where this is not the same I can think of is InputFileCT, which does not have baseline coverage files anyway. -- MOS_MIGRATED_REVID=86682774
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java b/src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java
index 70510f702c..b6cbdf91e0 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/TopLevelArtifactHelper.java
@@ -118,8 +118,12 @@ public final class TopLevelArtifactHelper {
for (String outputGroup : context.outputGroups()) {
NestedSet<Artifact> results = topLevelArtifactProvider.getOutputGroup(outputGroup);
if (results != null) {
- importantBuilder.addTransitive(results);
- }
+ if (outputGroup.startsWith(TopLevelArtifactProvider.HIDDEN_OUTPUT_GROUP_PREFIX)) {
+ allBuilder.addTransitive(results);
+ } else {
+ importantBuilder.addTransitive(results);
+ }
+ }
}
}
@@ -157,29 +161,8 @@ public final class TopLevelArtifactHelper {
}
}
- allBuilder.addAll(getCoverageArtifacts(target, context));
-
NestedSet<Artifact> importantArtifacts = importantBuilder.build();
allBuilder.addTransitive(importantArtifacts);
return new ArtifactsToBuild(importantArtifacts, allBuilder.build());
}
-
- private static Iterable<Artifact> getCoverageArtifacts(TransitiveInfoCollection target,
- TopLevelArtifactContext topLevelOptions) {
- if (!topLevelOptions.compileOnly() && !topLevelOptions.compilationPrerequisitesOnly()
- && topLevelOptions.shouldRunTests()) {
- // Add baseline code coverage artifacts if we are collecting code coverage. We do that only
- // when running tests.
- // It might be slightly faster to first check if any configuration has coverage enabled.
- if (target.getConfiguration() != null
- && target.getConfiguration().isCodeCoverageEnabled()) {
- BaselineCoverageArtifactsProvider provider =
- target.getProvider(BaselineCoverageArtifactsProvider.class);
- if (provider != null) {
- return provider.getBaselineCoverageArtifacts();
- }
- }
- }
- return ImmutableList.of();
- }
}