From c922f175dda771dcdd663004e4c0e921b892138d Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 8 Sep 2014 10:05:53 -0400 Subject: [PATCH] Add test suite for the sbt scripted plugin. --- .../sbt-test/scripted-plugin/argument-passing/build.sbt | 5 +++++ .../scripted-plugin/argument-passing/project/scripted.sbt | 3 +++ .../argument-passing/src/sbt-test/some/bad-test/test | 1 + .../argument-passing/src/sbt-test/some/good-test/test | 1 + .../argument-passing/src/sbt-test/some/good-test/tmp | 0 .../argument-passing/src/sbt-test/someOther/test | 1 + .../argument-passing/src/sbt-test/someOther/tmp | 0 sbt/src/sbt-test/scripted-plugin/argument-passing/test | 7 +++++++ scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala | 2 ++ 9 files changed, 20 insertions(+) create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/build.sbt create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/project/scripted.sbt create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/bad-test/test create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/test create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/tmp create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/test create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/tmp create mode 100644 sbt/src/sbt-test/scripted-plugin/argument-passing/test diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/build.sbt b/sbt/src/sbt-test/scripted-plugin/argument-passing/build.sbt new file mode 100644 index 000000000..da941d668 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/build.sbt @@ -0,0 +1,5 @@ +name := "test" + +scriptedSettings + +sbtPlugin := true \ No newline at end of file diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/project/scripted.sbt b/sbt/src/sbt-test/scripted-plugin/argument-passing/project/scripted.sbt new file mode 100644 index 000000000..c3b4f97e4 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/project/scripted.sbt @@ -0,0 +1,3 @@ +libraryDependencies <+= (sbtVersion) { sv => + "org.scala-sbt" % "scripted-plugin" % sv +} \ No newline at end of file diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/bad-test/test b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/bad-test/test new file mode 100644 index 000000000..50ee82a69 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/bad-test/test @@ -0,0 +1 @@ +$ exists tmp2 \ No newline at end of file diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/test b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/test new file mode 100644 index 000000000..ed33a6eb2 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/test @@ -0,0 +1 @@ +$ exists tmp \ No newline at end of file diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/tmp b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/some/good-test/tmp new file mode 100644 index 000000000..e69de29bb diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/test b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/test new file mode 100644 index 000000000..ed33a6eb2 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/test @@ -0,0 +1 @@ +$ exists tmp \ No newline at end of file diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/tmp b/sbt/src/sbt-test/scripted-plugin/argument-passing/src/sbt-test/someOther/tmp new file mode 100644 index 000000000..e69de29bb diff --git a/sbt/src/sbt-test/scripted-plugin/argument-passing/test b/sbt/src/sbt-test/scripted-plugin/argument-passing/test new file mode 100644 index 000000000..0e4d31e76 --- /dev/null +++ b/sbt/src/sbt-test/scripted-plugin/argument-passing/test @@ -0,0 +1,7 @@ +> scripted some/good-test +-> scripted some/bad-test +-> scripted some/* +-> scripted someOther/* +-> scripted some/NonExistentTest +-> scripted someNonExistentGroup/* +-> scripted someNonExistentGroup/someNonExistentTest \ No newline at end of file diff --git a/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala b/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala index 4195846fd..b8d6a7ede 100644 --- a/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala +++ b/scripted/plugin/src/main/scala/sbt/ScriptedPlugin.scala @@ -10,6 +10,8 @@ import classpath.ClasspathUtilities import java.lang.reflect.{ InvocationTargetException, Method } import java.util.Properties +// TODO - This should hook into the sbt test-interface +// TODO - Adapt this into an autoplugin as well. object ScriptedPlugin extends Plugin { def scriptedConf = config("scripted-sbt") hide def scriptedLaunchConf = config("scripted-sbt-launch") hide