Add ThisBuildScope

This commit is contained in:
Adrien Piquerez 2024-11-01 12:25:23 +01:00
parent a28428f96c
commit 2015c5d41a
2 changed files with 4 additions and 2 deletions

View File

@ -15,6 +15,7 @@ import sbt.internal.util.Dag
import sbt.internal.util.complete.Parser
import sbt.internal.util.complete.DefaultParsers
import Scope.ThisScope
import sbt.Scope.ThisBuildScope
sealed trait ProjectDefinition[PR <: ProjectReference] {
@ -345,10 +346,10 @@ object Project:
ss.map(_.mapReferenced(f))
def inThisBuild(ss: Seq[Setting[?]]): Seq[Setting[?]] =
inScope(ThisScope.copy(project = Select(ThisBuild)))(ss)
inScope(ThisBuildScope)(ss)
private[sbt] def inThisBuild[T](i: Initialize[T]): Initialize[T] =
inScope(ThisScope.copy(project = Select(ThisBuild)), i)
inScope(ThisBuildScope, i)
private[sbt] def inConfig[T](conf: Configuration, i: Initialize[T]): Initialize[T] =
inScope(ThisScope.copy(config = Select(conf)), i)

View File

@ -56,6 +56,7 @@ object Scope:
val ThisScope: Scope = new Scope(This, This, This, This)
val Global: Scope = new Scope(Zero, Zero, Zero, Zero)
val ThisBuildScope: Scope = Scope(Select(ThisBuild), This, This, This)
val GlobalScope: Scope = Global
private[sbt] final val inIsDeprecated =