mirror of https://github.com/sbt/sbt.git
Remember current URI + more tests. Review by @harrah
This commit is contained in:
parent
0dafd5ef26
commit
33ec1c419d
|
|
@ -534,8 +534,10 @@ object Load
|
|||
}
|
||||
|
||||
def initialSession(structure: BuildStructure, rootEval: () => Eval, s: State): SessionSettings = {
|
||||
val current = s get Keys.sessionSettings map (_.currentProject) getOrElse Map.empty
|
||||
new SessionSettings(structure.root, projectMap(structure, current), structure.settings, Map.empty, Nil, rootEval)
|
||||
val session = s get Keys.sessionSettings
|
||||
val currentProject = session map (_.currentProject) getOrElse Map.empty
|
||||
val currentBuild = session map (_.currentBuild) filter (uri => structure.units.keys exists (uri ==)) getOrElse structure.root
|
||||
new SessionSettings(currentBuild, projectMap(structure, currentProject), structure.settings, Map.empty, Nil, rootEval)
|
||||
}
|
||||
|
||||
def initialSession(structure: BuildStructure, rootEval: () => Eval): SessionSettings =
|
||||
|
|
@ -546,8 +548,8 @@ object Load
|
|||
val units = structure.units
|
||||
val getRoot = getRootProject(units)
|
||||
def project(uri: URI) = {
|
||||
current get uri map {
|
||||
p => if (structure allProjects uri map (_.id) contains p) p else getRoot(uri)
|
||||
current get uri filter {
|
||||
p => structure allProjects uri map (_.id) contains p
|
||||
} getOrElse getRoot(uri)
|
||||
}
|
||||
units.keys.map(uri => (uri, project(uri))).toMap
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
import sbt._
|
||||
|
||||
object Build1 extends Build
|
||||
{
|
||||
lazy val root1 = Project("root1", file("root1")) settings(
|
||||
TaskKey[Unit]("g") := {}
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
import sbt._
|
||||
|
||||
object Build2 extends Build
|
||||
{
|
||||
lazy val root2 = Project("root2", file("root2"))
|
||||
}
|
||||
|
|
@ -2,4 +2,12 @@
|
|||
> project sub
|
||||
> f
|
||||
> reload
|
||||
> f
|
||||
> f
|
||||
$ copy-file changes/Build1.scala project/TestProject.scala
|
||||
> reload
|
||||
-> f
|
||||
> g
|
||||
# The current URI should be kept
|
||||
$ copy-file changes/Build2.scala project/First.scala
|
||||
> reload
|
||||
> g
|
||||
Loading…
Reference in New Issue