settings ordering test

This commit is contained in:
Mark Harrah 2011-07-23 23:07:54 -04:00
parent 960d0bc2e3
commit 38aa811d50
7 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,8 @@
import complete.DefaultParsers._
InputKey[Unit]("check") <<= InputTask(_ => Space ~> IntBasic) { result =>
(result, maxErrors) map { (expected, actual) =>
assert(expected == actual, "Expected " + expected + ", got " + actual)
}
}

View File

@ -0,0 +1,9 @@
import sbt._
import Keys._
object B extends Build
{
lazy val root = Project("root", file(".")) settings(
maxErrors ~= (_ * 9)
)
}

View File

@ -0,0 +1,9 @@
import sbt._
import Keys._
object P extends Plugin
{
override def settings = Seq(
maxErrors ~= (x => x*x)
)
}

View File

@ -0,0 +1 @@
maxErrors ~= (_ / 25)

View File

@ -0,0 +1 @@
maxErrors ~= (_ + 3)

View File

@ -0,0 +1 @@
maxErrors ~= (_ / 10)

View File

@ -0,0 +1,25 @@
# checks order of injected settings
> set logLevel := Level.Debug
# default, in Global scope
> check 100
# div by 25
$ copy-file changes/global.sbt global/settings.sbt
> reload
> check 4
# add 3
$ copy-file changes/local.sbt local.sbt
> reload
> check 7
# square
$ copy-file changes/Global.scala global/plugins/Global.scala
> reload
> check 19
# multiply by 9
$ copy-file changes/Build.scala project/Build.scala
> reload
> check 1299