mirror of https://github.com/sbt/sbt.git
Update reflection signature for scripted plugin, add test for the plugin.
This commit is contained in:
parent
598b6209e3
commit
fd713e0c96
|
|
@ -0,0 +1 @@
|
|||
ScriptedPlugin.scriptedSettings
|
||||
|
|
@ -0,0 +1 @@
|
|||
object Fail {
|
||||
|
|
@ -0,0 +1 @@
|
|||
object Success
|
||||
|
|
@ -0,0 +1 @@
|
|||
-> compile
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
$ copy-file changes/Success.scala Success.scala
|
||||
> compile
|
||||
$ copy-file changes/Fail.scala Fail.scala
|
||||
-> compile
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
libraryDependencies <+= sbtVersion { sv =>
|
||||
"org.scala-sbt" % "scripted-plugin" % sv
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
$ copy-file changes/test src/sbt-test/group/demo/test
|
||||
$ copy-file changes/Fail.scala src/sbt-test/group/demo/changes/Fail.scala
|
||||
$ copy-file changes/Success.scala src/sbt-test/group/demo/changes/Success.scala
|
||||
$ copy-file changes/fail src/sbt-test/group/fail/test
|
||||
> scripted group/demo
|
||||
-> scripted group/fail
|
||||
|
|
@ -32,7 +32,7 @@ object ScriptedPlugin extends Plugin {
|
|||
|
||||
def scriptedRunTask: Initialize[Task[Method]] = (scriptedTests) map {
|
||||
(m) =>
|
||||
m.getClass.getMethod("run", classOf[File], classOf[Boolean], classOf[String], classOf[String], classOf[String], classOf[Array[String]], classOf[File], classOf[Array[String]])
|
||||
m.getClass.getMethod("run", classOf[File], classOf[Boolean], classOf[Array[String]], classOf[File], classOf[Array[String]])
|
||||
}
|
||||
|
||||
def scriptedTask: Initialize[InputTask[Unit]] = Def.inputTask {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ object ScriptedTests
|
|||
}
|
||||
def runAll(tests: Seq[() => Option[String]])
|
||||
{
|
||||
val errors = for(test <- tests.par; err <- test()) yield err
|
||||
val errors = for(test <- tests; err <- test()) yield err
|
||||
if(errors.nonEmpty)
|
||||
sys.error(errors.mkString("Failed tests:\n\t", "\n\t", "\n"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue