Fix aggregation

This commit is contained in:
Eugene Yokota 2022-12-27 03:43:10 -05:00
parent a20d5205af
commit fc31bc3d15
4 changed files with 15 additions and 6 deletions

View File

@ -251,12 +251,12 @@ object Aggregation {
proj: Option[Reference],
extra: BuildUtil[Proj],
reverse: Boolean
): Seq[ProjectRef] = {
): Seq[ProjectRef] =
val resRef = proj.map(p => extra.projectRefFor(extra.resolveRef(p)))
resRef.toList.flatMap(ref =>
if (reverse) extra.aggregates.reverse(ref) else extra.aggregates.forward(ref)
)
}
resRef.toList.flatMap { ref =>
if reverse then extra.aggregates.reverse(ref)
else extra.aggregates.forward(ref)
}
def aggregate[T, Proj](
key: ScopedKey[T],

View File

@ -114,7 +114,7 @@ object BuildUtil {
val depPairs =
for {
(uri, unit) <-
units.toIterable // don't lose this toIterable, doing so breaks actions/cross-multiproject & actions/update-state-fail
units.toSeq // don't lose this toSeq, doing so breaks actions/cross-multiproject & actions/update-state-fail
project <- unit.projects
ref = ProjectRef(uri, project.id)
agg <- project.aggregate

View File

@ -0,0 +1,4 @@
package foo
object B

View File

@ -6,6 +6,11 @@ $ exists core/target/scala-3.0.2
-$ exists subproj/target/scala-3.1.2
> clean
-$ exists core/target/scala-3.0.2
-$ exists core/target/scala-3.1.2
-$ exists subproj/target/scala-3.0.2
-$ exists subproj/target/scala-3.1.2
> ++3.1.2 compile
-$ exists core/target/scala-3.0.2