mirror of https://github.com/sbt/sbt.git
settings ordering test
This commit is contained in:
parent
960d0bc2e3
commit
38aa811d50
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
|
||||
object B extends Build
|
||||
{
|
||||
lazy val root = Project("root", file(".")) settings(
|
||||
maxErrors ~= (_ * 9)
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import sbt._
|
||||
import Keys._
|
||||
|
||||
object P extends Plugin
|
||||
{
|
||||
override def settings = Seq(
|
||||
maxErrors ~= (x => x*x)
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
maxErrors ~= (_ / 25)
|
||||
|
|
@ -0,0 +1 @@
|
|||
maxErrors ~= (_ + 3)
|
||||
|
|
@ -0,0 +1 @@
|
|||
maxErrors ~= (_ / 10)
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue