Skip to content

Commit

Permalink
Remove "command artifacts" from TopLevelContextProvider.
Browse files Browse the repository at this point in the history
--
MOS_MIGRATED_REVID=86177564
  • Loading branch information
lberki authored and hanwen committed Feb 12, 2015
1 parent d54960e commit 4a8b050
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ private TopLevelArtifactHelper() {
// Prevent instantiation.
}

/** Returns command-specific artifacts which may exist for a given target and build command. */
private static final Iterable<Artifact> getCommandArtifacts(TransitiveInfoCollection target,
String buildCommand) {
TopLevelArtifactProvider provider = target.getProvider(TopLevelArtifactProvider.class);
if (provider != null
&& provider.getCommandsForExtraArtifacts().contains(buildCommand.toLowerCase())) {
return provider.getArtifactsForCommand();
} else {
return ImmutableList.of();
}
}

/**
* Utility function to form a list of all test output Artifacts of the given targets to test.
*/
Expand Down Expand Up @@ -132,7 +120,6 @@ public static NestedSet<Artifact> getAllArtifactsToBuild(TransitiveInfoCollectio
}
}

allArtifacts.addAll(getCommandArtifacts(target, options.buildCommand()));
allArtifacts.addAll(getCoverageArtifacts(target, options));
return allArtifacts.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

package com.google.devtools.build.lib.analysis;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
Expand All @@ -26,34 +25,12 @@
*/
@Immutable
public final class TopLevelArtifactProvider implements TransitiveInfoProvider {

private final ImmutableList<String> commandsForExtraArtifacts;
private final ImmutableList<Artifact> artifactsForCommand;
private final ImmutableMap<String, NestedSet<Artifact>> outputGroups;

public TopLevelArtifactProvider(ImmutableList<String> commandsForExtraArtifacts,
ImmutableList<Artifact> artifactsForCommand) {
this.commandsForExtraArtifacts = commandsForExtraArtifacts;
this.artifactsForCommand = artifactsForCommand;
this.outputGroups = ImmutableMap.<String, NestedSet<Artifact>>of();
}

public TopLevelArtifactProvider(String key, NestedSet<Artifact> artifactsToBuild) {
this.commandsForExtraArtifacts = ImmutableList.of();
this.artifactsForCommand = ImmutableList.of();
this.outputGroups = ImmutableMap.<String, NestedSet<Artifact>>of(key, artifactsToBuild);
}

/** Returns the commands (in lowercase) that this provider should provide artifacts for. */
public ImmutableList<String> getCommandsForExtraArtifacts() {
return commandsForExtraArtifacts;
}

/** Returns the extra artifacts for the commands. */
public ImmutableList<Artifact> getArtifactsForCommand() {
return artifactsForCommand;
}

/** Returns artifacts that are to be built for every command. */
public NestedSet<Artifact> getOutputGroup(String outputGroupName) {
return outputGroups.get(outputGroupName);
Expand Down

0 comments on commit 4a8b050

Please sign in to comment.