mirror of https://github.com/sbt/sbt.git
Handle DynamicDepsInitialize in settings evaluation (fix actions/multi-scope MatchError)
- Expose inner Initialize on DynamicDepsInitialize (val inner) in Settings.scala - Add DynamicDepsInitialize case in INode.scala transform; delegate to inner init - Include ScopeFilter.scala scalafmt changes
This commit is contained in:
parent
da3b0deb5f
commit
f8b7d61b5a
|
|
@ -236,13 +236,18 @@ object ScopeFilter {
|
||||||
.groupBy(_.project)
|
.groupBy(_.project)
|
||||||
.view
|
.view
|
||||||
.mapValues: byProj =>
|
.mapValues: byProj =>
|
||||||
byProj.groupBy(_.config).view.mapValues: byConfig =>
|
byProj
|
||||||
|
.groupBy(_.config)
|
||||||
|
.view
|
||||||
|
.mapValues: byConfig =>
|
||||||
byConfig.groupBy(_.task).view.mapValues(_.toSet).toMap
|
byConfig.groupBy(_.task).view.mapValues(_.toSet).toMap
|
||||||
.toMap
|
.toMap
|
||||||
.toMap
|
.toMap
|
||||||
new Data(units, resolve, new AllScopes(scopes, grouped))
|
new Data(units, resolve, new AllScopes(scopes, grouped))
|
||||||
|
|
||||||
def expandDynamicDeps(deps: Seq[Any], structure: BuildStructure): Set[Def.ScopedKey[?]] =
|
def expandDynamicDeps(deps: Seq[Any], structure: BuildStructure): Set[
|
||||||
|
Def.ScopedKey[?]
|
||||||
|
] =
|
||||||
if deps.isEmpty then Set.empty
|
if deps.isEmpty then Set.empty
|
||||||
else
|
else
|
||||||
val data = dataFromStructure(structure)
|
val data = dataFromStructure(structure)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ class EvaluateSettings[I <: Init](
|
||||||
o.a match
|
o.a match
|
||||||
case None => constant(() => o.f(None))
|
case None => constant(() => o.f(None))
|
||||||
case Some(i) => single[s, A](transform(i), x => o.f(Some(x)))
|
case Some(i) => single[s, A](transform(i), x => o.f(Some(x)))
|
||||||
|
case d: DynamicDepsInitialize[A] => transform(d.inner)
|
||||||
case StaticScopes => strictConstant(allScopes)
|
case StaticScopes => strictConstant(allScopes)
|
||||||
|
|
||||||
private lazy val roots: Seq[INode[?]] = compiledSettings.flatMap { cs =>
|
private lazy val roots: Seq[INode[?]] = compiledSettings.flatMap { cs =>
|
||||||
|
|
|
||||||
|
|
@ -1008,7 +1008,7 @@ trait Init:
|
||||||
end Apply
|
end Apply
|
||||||
|
|
||||||
private[sbt] final class DynamicDepsInitialize[A1](
|
private[sbt] final class DynamicDepsInitialize[A1](
|
||||||
inner: Initialize[A1],
|
val inner: Initialize[A1],
|
||||||
val dynamicDeps: Seq[Any]
|
val dynamicDeps: Seq[Any]
|
||||||
) extends Initialize[A1]:
|
) extends Initialize[A1]:
|
||||||
override def dependencies: Seq[ScopedKey[?]] = inner.dependencies
|
override def dependencies: Seq[ScopedKey[?]] = inner.dependencies
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue