Merge pull request #1591 from cunei/wip-set-every-1430

Fix for #1430
This commit is contained in:
Josh Suereth 2014-09-12 22:54:29 -04:00
commit c6036d956a
3 changed files with 21 additions and 2 deletions

View File

@ -27,7 +27,7 @@ private[sbt] object SettingCompletions {
{
import extracted._
val r = relation(extracted.structure, true)
val allDefs = r._1s.toSeq
val allDefs = Def.flattenLocals(Def.compiled(extracted.structure.settings, true)(structure.delegates, structure.scopeLocal, implicitly[Show[ScopedKey[_]]])).map(_._1)
val projectScope = Load.projectScope(currentRef)
def resolve(s: Setting[_]): Seq[Setting[_]] = Load.transformSettings(projectScope, currentRef.build, rootProject, s :: Nil)
def rescope[T](setting: Setting[T]): Seq[Setting[_]] =
@ -353,4 +353,4 @@ private[sbt] object SettingCompletions {
classOf[Long],
classOf[String]
)
}
}

View File

@ -0,0 +1,16 @@
val a = project.settings(version := "2.8.1")
val trySetEvery = taskKey[Unit]("Tests \"set every\"")
trySetEvery := {
val s = state.value
val extracted = Project.extract(s)
import extracted._
val allProjs = structure.allProjectRefs
val Some(aProj) = allProjs.find(_.project == "a")
val aVer = (version in aProj get structure.data).get
if (aVer != "1.0") {
println("Version of project a: " + aVer + ", expected: 1.0")
error("\"set every\" did not change the version of all projects.")
}
}

View File

@ -0,0 +1,3 @@
> set every version := '"1.0"'
> trySetEvery