diff --git a/build.sbt b/build.sbt index 6ce25b9..ab32416 100644 --- a/build.sbt +++ b/build.sbt @@ -4,17 +4,15 @@ organization := "com.github.daniel-shuy" name := "sbt-scripted-scalatest" -version := "1.1.0-SNAPSHOT" - licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")) homepage := Some(url("https://github.com/daniel-shuy/scripted-scalatest-sbt-plugin")) crossSbtVersions := Seq( - "0.13.16", - "1.1.0" + "0.13.17", + "1.2.6" ) libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.5" + "org.scalatest" %% "scalatest" % "3.0.0" ) diff --git a/project/bintray.sbt b/project/bintray.sbt index e674f39..945dd61 100644 --- a/project/bintray.sbt +++ b/project/bintray.sbt @@ -1 +1 @@ -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.2") +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") diff --git a/project/build.properties b/project/build.properties index c4dc11b..091249b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.1.0 +sbt.version = 1.2.6 diff --git a/project/release.sbt b/project/release.sbt new file mode 100644 index 0000000..1c5c52f --- /dev/null +++ b/project/release.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.10") diff --git a/publish.sbt b/publish.sbt index 59c7ec0..527116c 100644 --- a/publish.sbt +++ b/publish.sbt @@ -1,3 +1,7 @@ publishMavenStyle := false bintrayRepository := "sbt-plugins" + +bintrayPackageLabels := Seq("sbt", "sbt-plugin", "sbt-test", "scripted", "scripted-plugin", "scalatest") + +bintrayReleaseOnPublish := false diff --git a/release.sbt b/release.sbt new file mode 100644 index 0000000..379e4cf --- /dev/null +++ b/release.sbt @@ -0,0 +1,16 @@ +import ReleaseTransformations._ +releaseProcess := Seq[ReleaseStep]( + checkSnapshotDependencies, + inquireVersions, + runClean, + releaseStepCommandAndRemaining("^ test"), + releaseStepCommandAndRemaining("^ scripted"), + setReleaseVersion, + commitReleaseVersion, + tagRelease, + releaseStepCommandAndRemaining("^ publish"), + releaseStepTask(bintrayRelease), + setNextVersion, + commitNextVersion, + pushChanges +) diff --git a/scripted.sbt b/scripted.sbt new file mode 100644 index 0000000..b01dac0 --- /dev/null +++ b/scripted.sbt @@ -0,0 +1,5 @@ +enablePlugins(SbtPlugin) +scriptedLaunchOpts := { scriptedLaunchOpts.value ++ + Seq("-Xmx1024M", "-Dplugin.version=" + version.value) +} +scriptedBufferLog := false diff --git a/src/main/scala/org/scalatest/ScriptedScalaTestSuite.scala b/src/main/scala/org/scalatest/ScriptedScalaTestSuite.scala index 2ca5195..2a79cf6 100644 --- a/src/main/scala/org/scalatest/ScriptedScalaTestSuite.scala +++ b/src/main/scala/org/scalatest/ScriptedScalaTestSuite.scala @@ -21,7 +21,7 @@ trait ScriptedScalaTestSuite extends Suite { * @return [[org.scalatest.FailedStatus]] on error, * else the return from [[org.scalatest.Suite.run(Option[String],org.scalatest.Args)]]. */ - def executeScripted(testName: String = null, + final def executeScripted(testName: String = null, configMap: ConfigMap = ConfigMap.empty, color: Boolean = true, durations: Boolean = false, diff --git a/src/sbt-test/sbt-0.13/testFailure/build.sbt b/src/sbt-test/sbt-0.13/testFailure/build.sbt new file mode 100644 index 0000000..a2b9d94 --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/build.sbt @@ -0,0 +1,32 @@ +import com.github.daniel.shuy.sbt.scripted.scalatest.ScriptedScalaTestSuiteMixin +import org.scalatest.Assertions._ +import org.scalatest.WordSpec + +lazy val testFailure = project + .in(file(".")) + .settings( + name := "test/sbt-0.13/testFailure", + + ScriptedPlugin.scriptedSettings, + sys.props.get("plugin.version") match { + case Some(pluginVersion) => scriptedLaunchOpts := { scriptedLaunchOpts.value ++ + Seq("-Xmx1024M", "-XX:MaxPermSize=256M", "-Dplugin.version=" + pluginVersion) + } + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) + }, + scriptedBufferLog := false, + + scriptedScalaTestStacks := SbtScriptedScalaTest.FullStacks, + scriptedScalaTestSpec := Some(new WordSpec with ScriptedScalaTestSuiteMixin { + override val sbtState: State = state.value + + "scripted" should { + "fail on ScalaTest failure" in { + assertThrows[sbt.Incomplete]( + Project.extract(sbtState) + .runInputTask(scripted, "", sbtState)) + } + } + }) + ) diff --git a/src/sbt-test/sbt-0.13/testFailure/project/build.properties b/src/sbt-test/sbt-0.13/testFailure/project/build.properties new file mode 100644 index 0000000..0db266d --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/project/build.properties @@ -0,0 +1 @@ +sbt.version = 0.13.17 diff --git a/src/sbt-test/sbt-0.13/testFailure/project/plugins.sbt b/src/sbt-test/sbt-0.13/testFailure/project/plugins.sbt new file mode 100644 index 0000000..e52fa44 --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/project/plugins.sbt @@ -0,0 +1,5 @@ +sys.props.get("plugin.version") match { + case Some(pluginVersion) => addSbtPlugin("com.github.daniel-shuy" % "sbt-scripted-scalatest" % pluginVersion) + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) +} diff --git a/src/sbt-test/sbt-0.13/testFailure/project/scripted.sbt b/src/sbt-test/sbt-0.13/testFailure/project/scripted.sbt new file mode 100644 index 0000000..765326c --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/project/scripted.sbt @@ -0,0 +1 @@ +libraryDependencies += { "org.scala-sbt" % "scripted-plugin" % sbtVersion.value } diff --git a/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/build.sbt b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/build.sbt new file mode 100644 index 0000000..532a3d0 --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/build.sbt @@ -0,0 +1,20 @@ +import com.github.daniel.shuy.sbt.scripted.scalatest.ScriptedScalaTestSuiteMixin +import org.scalatest.Assertions._ +import org.scalatest.WordSpec + +lazy val testBasicSimple = project + .in(file(".")) + .settings( + name := "test/basic/simple", + + scriptedScalaTestStacks := SbtScriptedScalaTest.FullStacks, + scriptedScalaTestSpec := Some(new WordSpec with ScriptedScalaTestSuiteMixin { + override val sbtState: State = state.value + + "scripted test" should { + "fail" in { + fail() + } + } + }) + ) diff --git a/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/build.properties b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/build.properties new file mode 100644 index 0000000..0db266d --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/build.properties @@ -0,0 +1 @@ +sbt.version = 0.13.17 diff --git a/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/plugins.sbt b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/plugins.sbt new file mode 100644 index 0000000..e52fa44 --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/plugins.sbt @@ -0,0 +1,5 @@ +sys.props.get("plugin.version") match { + case Some(pluginVersion) => addSbtPlugin("com.github.daniel-shuy" % "sbt-scripted-scalatest" % pluginVersion) + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) +} diff --git a/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/test b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/test new file mode 100644 index 0000000..57e380e --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/test @@ -0,0 +1 @@ +> scriptedScalatest diff --git a/src/sbt-test/sbt-0.13/testFailure/test b/src/sbt-test/sbt-0.13/testFailure/test new file mode 100644 index 0000000..57e380e --- /dev/null +++ b/src/sbt-test/sbt-0.13/testFailure/test @@ -0,0 +1 @@ +> scriptedScalatest diff --git a/src/sbt-test/sbt-1.0/testFailure/build.sbt b/src/sbt-test/sbt-1.0/testFailure/build.sbt new file mode 100644 index 0000000..6aa2e4e --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/build.sbt @@ -0,0 +1,32 @@ +import com.github.daniel.shuy.sbt.scripted.scalatest.ScriptedScalaTestSuiteMixin +import org.scalatest.Assertions._ +import org.scalatest.WordSpec + +lazy val testFailure = project + .in(file(".")) + .enablePlugins(SbtPlugin) + .settings( + name := "test/sbt-0.13/testFailure", + + sys.props.get("plugin.version") match { + case Some(pluginVersion) => scriptedLaunchOpts := { scriptedLaunchOpts.value ++ + Seq("-Xmx1024M", "-Dplugin.version=" + pluginVersion) + } + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) + }, + scriptedBufferLog := false, + + scriptedScalaTestStacks := SbtScriptedScalaTest.FullStacks, + scriptedScalaTestSpec := Some(new WordSpec with ScriptedScalaTestSuiteMixin { + override val sbtState: State = state.value + + "scripted" should { + "fail on ScalaTest failure" in { + assertThrows[sbt.Incomplete]( + Project.extract(sbtState) + .runInputTask(scripted, "", sbtState)) + } + } + }) + ) diff --git a/src/sbt-test/sbt-1.0/testFailure/project/build.properties b/src/sbt-test/sbt-1.0/testFailure/project/build.properties new file mode 100644 index 0000000..091249b --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/project/build.properties @@ -0,0 +1 @@ +sbt.version = 1.2.6 diff --git a/src/sbt-test/sbt-1.0/testFailure/project/plugins.sbt b/src/sbt-test/sbt-1.0/testFailure/project/plugins.sbt new file mode 100644 index 0000000..e52fa44 --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/project/plugins.sbt @@ -0,0 +1,5 @@ +sys.props.get("plugin.version") match { + case Some(pluginVersion) => addSbtPlugin("com.github.daniel-shuy" % "sbt-scripted-scalatest" % pluginVersion) + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) +} diff --git a/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/build.sbt b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/build.sbt new file mode 100644 index 0000000..532a3d0 --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/build.sbt @@ -0,0 +1,20 @@ +import com.github.daniel.shuy.sbt.scripted.scalatest.ScriptedScalaTestSuiteMixin +import org.scalatest.Assertions._ +import org.scalatest.WordSpec + +lazy val testBasicSimple = project + .in(file(".")) + .settings( + name := "test/basic/simple", + + scriptedScalaTestStacks := SbtScriptedScalaTest.FullStacks, + scriptedScalaTestSpec := Some(new WordSpec with ScriptedScalaTestSuiteMixin { + override val sbtState: State = state.value + + "scripted test" should { + "fail" in { + fail() + } + } + }) + ) diff --git a/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/build.properties b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/build.properties new file mode 100644 index 0000000..091249b --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/build.properties @@ -0,0 +1 @@ +sbt.version = 1.2.6 diff --git a/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/plugins.sbt b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/plugins.sbt new file mode 100644 index 0000000..e52fa44 --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/plugins.sbt @@ -0,0 +1,5 @@ +sys.props.get("plugin.version") match { + case Some(pluginVersion) => addSbtPlugin("com.github.daniel-shuy" % "sbt-scripted-scalatest" % pluginVersion) + case _ => sys.error("""|The system property 'plugin.version' is not defined. + |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) +} diff --git a/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/test b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/test new file mode 100644 index 0000000..57e380e --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/test @@ -0,0 +1 @@ +> scriptedScalatest diff --git a/src/sbt-test/sbt-1.0/testFailure/test b/src/sbt-test/sbt-1.0/testFailure/test new file mode 100644 index 0000000..57e380e --- /dev/null +++ b/src/sbt-test/sbt-1.0/testFailure/test @@ -0,0 +1 @@ +> scriptedScalatest diff --git a/version.sbt b/version.sbt new file mode 100644 index 0000000..48af491 --- /dev/null +++ b/version.sbt @@ -0,0 +1 @@ +version in ThisBuild := "1.1.0"