mirror of https://github.com/sbt/sbt.git
Use caching in Project.transform
This commit is contained in:
parent
8b5eaa2cd5
commit
9382fc99b7
|
|
@ -16,6 +16,7 @@ import sbt.internal.util.complete.Parser
|
||||||
import sbt.internal.util.complete.DefaultParsers
|
import sbt.internal.util.complete.DefaultParsers
|
||||||
import Scope.ThisScope
|
import Scope.ThisScope
|
||||||
import sbt.Scope.ThisBuildScope
|
import sbt.Scope.ThisBuildScope
|
||||||
|
import sbt.internal.util.Util
|
||||||
|
|
||||||
sealed trait ProjectDefinition[PR <: ProjectReference] {
|
sealed trait ProjectDefinition[PR <: ProjectReference] {
|
||||||
|
|
||||||
|
|
@ -336,14 +337,8 @@ object Project:
|
||||||
[a] => (k: ScopedKey[a]) => ScopedKey(f(k.scope), k.key)
|
[a] => (k: ScopedKey[a]) => ScopedKey(f(k.scope), k.key)
|
||||||
|
|
||||||
def transform(g: Scope => Scope, ss: Seq[Def.Setting[?]]): Seq[Def.Setting[?]] =
|
def transform(g: Scope => Scope, ss: Seq[Def.Setting[?]]): Seq[Def.Setting[?]] =
|
||||||
val f = mapScope(g)
|
val f = mapScope(Util.withCaching(g))
|
||||||
ss.map { setting =>
|
ss.map(_.mapKey(f).mapReferenced(f))
|
||||||
setting.mapKey(f).mapReferenced(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
def transformRef(g: Scope => Scope, ss: Seq[Def.Setting[?]]): Seq[Def.Setting[?]] =
|
|
||||||
val f = mapScope(g)
|
|
||||||
ss.map(_.mapReferenced(f))
|
|
||||||
|
|
||||||
def inThisBuild(ss: Seq[Setting[?]]): Seq[Setting[?]] =
|
def inThisBuild(ss: Seq[Setting[?]]): Seq[Setting[?]] =
|
||||||
inScope(ThisBuildScope)(ss)
|
inScope(ThisBuildScope)(ss)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ package object sbt
|
||||||
fillTaskAxis,
|
fillTaskAxis,
|
||||||
mapScope,
|
mapScope,
|
||||||
transform,
|
transform,
|
||||||
transformRef,
|
|
||||||
inThisBuild,
|
inThisBuild,
|
||||||
inScope,
|
inScope,
|
||||||
normalizeModuleID
|
normalizeModuleID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue