Update reflection signature for scripted plugin, add test for the plugin.

This commit is contained in:
Mark Harrah 2013-05-25 13:36:17 -04:00
parent 598b6209e3
commit fd713e0c96
9 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1 @@
ScriptedPlugin.scriptedSettings

View File

@ -0,0 +1 @@
object Fail {

View File

@ -0,0 +1 @@
object Success

View File

@ -0,0 +1 @@
-> compile

View File

@ -0,0 +1,4 @@
$ copy-file changes/Success.scala Success.scala
> compile
$ copy-file changes/Fail.scala Fail.scala
-> compile

View File

@ -0,0 +1,3 @@
libraryDependencies <+= sbtVersion { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}

View File

@ -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

View File

@ -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 {

View File

@ -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"))
}