diff options
author | 2018-03-14 14:26:30 -0700 | |
---|---|---|
committer | 2018-03-14 14:29:02 -0700 | |
commit | 92044990cdc318fa49cd769181ad9866a9d86ef6 (patch) | |
tree | cffc9c0a9c5f5150265c30cad920dade32c9380c /src/main | |
parent | 87bc83321b09b6e3fb01bd148c5f024af5fbe6c5 (diff) |
Dedupes aspects in BuildView
This change ensures that there is no duplicate aspect in AnalysisResult.
RELNOTES: None
PiperOrigin-RevId: 189086095
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/BuildView.java | 10 |
1 files changed, 5 insertions, 5 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 8c4c28ddbb..e9657f8ae0 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 @@ -320,14 +320,14 @@ public class BuildView { private final ImmutableSet<ConfiguredTarget> parallelTests; private final ImmutableSet<ConfiguredTarget> exclusiveTests; @Nullable private final TopLevelArtifactContext topLevelContext; - private final ImmutableList<AspectValue> aspects; + private final ImmutableSet<AspectValue> aspects; private final PackageRoots packageRoots; private final String workspaceName; List<TargetAndConfiguration> topLevelTargetsWithConfigs; private AnalysisResult( Collection<ConfiguredTarget> targetsToBuild, - Collection<AspectValue> aspects, + ImmutableSet<AspectValue> aspects, Collection<ConfiguredTarget> targetsToTest, Collection<ConfiguredTarget> targetsToSkip, @Nullable String error, @@ -340,7 +340,7 @@ public class BuildView { String workspaceName, List<TargetAndConfiguration> topLevelTargetsWithConfigs) { this.targetsToBuild = ImmutableSet.copyOf(targetsToBuild); - this.aspects = ImmutableList.copyOf(aspects); + this.aspects = aspects; this.targetsToTest = targetsToTest == null ? null : ImmutableList.copyOf(targetsToTest); this.targetsToSkip = ImmutableSet.copyOf(targetsToSkip); this.error = error; @@ -372,7 +372,7 @@ public class BuildView { * <p>If this list is empty, build the targets returned by {@code getTargetsToBuild()}. * Otherwise, only build these aspects of the targets returned by {@code getTargetsToBuild()}. */ - public Collection<AspectValue> getAspects() { + public ImmutableSet<AspectValue> getAspects() { return aspects; } @@ -641,7 +641,7 @@ public class BuildView { Collection<Target> testsToRun = loadingResult.getTestsToRun(); Set<ConfiguredTarget> configuredTargets = Sets.newLinkedHashSet(skyframeAnalysisResult.getConfiguredTargets()); - Collection<AspectValue> aspects = skyframeAnalysisResult.getAspects(); + ImmutableSet<AspectValue> aspects = ImmutableSet.copyOf(skyframeAnalysisResult.getAspects()); Set<ConfiguredTarget> allTargetsToTest = null; if (testsToRun != null) { |