Add a test to check for keeping a selected url upon reload.

This commit is contained in:
Eugene Vigdorchik 2012-02-04 21:10:30 -05:00 committed by Mark Harrah
parent 3efcc07b93
commit 1fd1b7803c
6 changed files with 18 additions and 17 deletions

View File

@ -611,7 +611,7 @@ object Load
{
val rootProject: URI => String = Load getRootProject units
def allProjects: Seq[ResolvedProject] = units.values.flatMap(_.defined.values).toSeq
def allProjects(build: URI): Seq[ResolvedProject] = units(build).defined.values.toSeq
def allProjects(build: URI): Seq[ResolvedProject] = units.get(build) map(_.defined.values.toSeq) getOrElse Seq.empty
def allProjectRefs: Seq[ProjectRef] = units.toSeq flatMap { case (build, unit) => refs(build, unit.defined.values.toSeq) }
def allProjectRefs(build: URI): Seq[ProjectRef] = refs(build, allProjects(build))
val extra: BuildUtil[ResolvedProject] = buildUtil(root, units, index.keyIndex, data)

View File

@ -1,8 +0,0 @@
import sbt._
object Build1 extends Build
{
lazy val root1 = Project("root1", file("root1")) settings(
TaskKey[Unit]("g") := {}
)
}

View File

@ -1,6 +0,0 @@
import sbt._
object Build2 extends Build
{
lazy val root2 = Project("root2", file("root2"))
}

View File

@ -0,0 +1,7 @@
import sbt._
object TestBuild extends Build
{
lazy val root1 = Project("root1", file(".")) dependsOn(root2)
lazy val root2 = ProjectRef(uri("external"), "root2")
}

View File

@ -0,0 +1,8 @@
import sbt._
object Ext extends Build
{
lazy val root2 = Project("root2", file("root2")) settings(
TaskKey[Unit]("g") := {}
)
}

View File

@ -3,11 +3,11 @@
> f
> reload
> f
$ copy-file changes/Build1.scala project/TestProject.scala
$ copy-file changes/Changed.scala project/TestProject.scala
> reload
-> f
> project {external}root2
> g
# The current URI should be kept
$ copy-file changes/Build2.scala project/First.scala
> reload
> g