Skip to content

Commit 05aab71

Browse files
LeFroschGoogler
andauthored
Handle output groups explicitly in deployment (#7347)
Bug: 385469770 Bug: 385546508 Test: existing Change-Id: Id077b2cee98a4186e81e7222ae0ea65d5b310036 AOSP: 7f3f6a874e415d342ebd7b81fb01a1e64041d88f Co-authored-by: Googler <[email protected]>
1 parent 9c59cee commit 05aab71

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

base/src/com/google/idea/blaze/base/sync/aspects/BlazeBuildOutputs.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import static com.google.common.collect.ImmutableList.toImmutableList;
1919
import static com.google.common.collect.ImmutableMap.toImmutableMap;
20+
import static com.google.common.collect.ImmutableSet.toImmutableSet;
2021

2122
import com.google.common.annotations.VisibleForTesting;
2223
import com.google.common.collect.ImmutableList;
@@ -102,12 +103,17 @@ private BlazeBuildOutputs(
102103
}
103104

104105
/** Returns the output artifacts generated for target with given label. */
105-
public ImmutableSet<OutputArtifact> artifactsForTarget(String label) {
106-
return perTargetArtifacts.get(label);
106+
public ImmutableSet<OutputArtifact> artifactsForTarget(String label, String outputGroup) {
107+
// TODO: solodkyy - This is slow although it is invoked at most two times.
108+
return artifacts.values().stream()
109+
.filter(a -> a.outputGroups.contains(outputGroup) && a.topLevelTargets.contains(label))
110+
.map(a -> a.artifact)
111+
.collect(toImmutableSet());
107112
}
108113

109114
@VisibleForTesting
110115
public ImmutableList<OutputArtifact> getOutputGroupArtifacts(String outputGroup) {
116+
// TODO: solodkyy - This is slow although it is invoked at most two times.
111117
return artifacts.values().stream()
112118
.filter(a -> a.outputGroups.contains(outputGroup))
113119
.map(a -> a.artifact)

0 commit comments

Comments
 (0)