From b7756fff4199d0d8ce23fc159ffdadf7e3ee6029 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 27 Oct 2018 00:54:29 +0800 Subject: [PATCH 01/13] Add final modifier to ScriptedScalaTestSuite#executeScripted(String,org.scalatest.ConfigMap,Boolean,Boolean,Boolean,Boolean,Boolean):Status --- src/main/scala/org/scalatest/ScriptedScalaTestSuite.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From d2ce097be34d8c632357ab48a03572a0a22f882e Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 27 Oct 2018 01:24:51 +0800 Subject: [PATCH 02/13] Reduce ScalaTest libraryDependency version to 3.0.0 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 6ce25b9..55e6e78 100644 --- a/build.sbt +++ b/build.sbt @@ -16,5 +16,5 @@ crossSbtVersions := Seq( ) libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.0.5" + "org.scalatest" %% "scalatest" % "3.0.0" ) From 9cc4424a8c9da9851e14d7b39becb9e0d4a22aa1 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Thu, 1 Nov 2018 00:19:33 +0800 Subject: [PATCH 03/13] Bump sbt.version to 1.2.6 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 0d52191e84463eb647e27d7b5d506051d5727490 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Thu, 1 Nov 2018 00:19:59 +0800 Subject: [PATCH 04/13] Bump crossSbtVersions to 0.13.17, 1.2.6 --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 55e6e78..a8964b8 100644 --- a/build.sbt +++ b/build.sbt @@ -11,8 +11,8 @@ licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/lice 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( From 21c8ba065f81b8500baa31b23386d590d44b6f03 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Thu, 1 Nov 2018 00:20:11 +0800 Subject: [PATCH 05/13] Bump sbt-bintray version to 0.5.4 --- project/bintray.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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") From 5c7ba7f3a6309d08378f901f3829968dac910aa9 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 14:30:13 +0800 Subject: [PATCH 06/13] Enable scripted tests --- scripted.sbt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 scripted.sbt 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 From 596a76bcb31e16671b6d0f5b72135cd0779d1bf2 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 14:46:25 +0800 Subject: [PATCH 07/13] Add scripted test sbt-0.13/testFailure --- src/sbt-test/sbt-0.13/testFailure/build.sbt | 32 +++++++++++++++++++ .../testFailure/project/build.properties | 1 + .../sbt-0.13/testFailure/project/plugins.sbt | 5 +++ .../sbt-0.13/testFailure/project/scripted.sbt | 1 + .../src/sbt-test/basic/simple/build.sbt | 20 ++++++++++++ .../basic/simple/project/build.properties | 1 + .../sbt-test/basic/simple/project/plugins.sbt | 5 +++ .../src/sbt-test/basic/simple/test | 1 + src/sbt-test/sbt-0.13/testFailure/test | 1 + 9 files changed, 67 insertions(+) create mode 100644 src/sbt-test/sbt-0.13/testFailure/build.sbt create mode 100644 src/sbt-test/sbt-0.13/testFailure/project/build.properties create mode 100644 src/sbt-test/sbt-0.13/testFailure/project/plugins.sbt create mode 100644 src/sbt-test/sbt-0.13/testFailure/project/scripted.sbt create mode 100644 src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/build.sbt create mode 100644 src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/build.properties create mode 100644 src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/project/plugins.sbt create mode 100644 src/sbt-test/sbt-0.13/testFailure/src/sbt-test/basic/simple/test create mode 100644 src/sbt-test/sbt-0.13/testFailure/test 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 From e724da7f1d74bc976bdb3ab1153f68c51001810c Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 14:46:38 +0800 Subject: [PATCH 08/13] Add scripted test sbt-1.0/testFailure --- src/sbt-test/sbt-1.0/testFailure/build.sbt | 32 +++++++++++++++++++ .../testFailure/project/build.properties | 1 + .../sbt-1.0/testFailure/project/plugins.sbt | 5 +++ .../src/sbt-test/basic/simple/build.sbt | 20 ++++++++++++ .../basic/simple/project/build.properties | 1 + .../sbt-test/basic/simple/project/plugins.sbt | 5 +++ .../src/sbt-test/basic/simple/test | 1 + src/sbt-test/sbt-1.0/testFailure/test | 1 + 8 files changed, 66 insertions(+) create mode 100644 src/sbt-test/sbt-1.0/testFailure/build.sbt create mode 100644 src/sbt-test/sbt-1.0/testFailure/project/build.properties create mode 100644 src/sbt-test/sbt-1.0/testFailure/project/plugins.sbt create mode 100644 src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/build.sbt create mode 100644 src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/build.properties create mode 100644 src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/project/plugins.sbt create mode 100644 src/sbt-test/sbt-1.0/testFailure/src/sbt-test/basic/simple/test create mode 100644 src/sbt-test/sbt-1.0/testFailure/test 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 From 691ed103499d4eac47cae1c49d05ab9608237c9c Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 14:47:16 +0800 Subject: [PATCH 09/13] Add sbt-release --- project/release.sbt | 1 + publish.sbt | 1 + release.sbt | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 project/release.sbt create mode 100644 release.sbt 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..f814077 100644 --- a/publish.sbt +++ b/publish.sbt @@ -1,3 +1,4 @@ publishMavenStyle := false bintrayRepository := "sbt-plugins" +bintrayReleaseOnPublish := false diff --git a/release.sbt b/release.sbt new file mode 100644 index 0000000..65d17bc --- /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("^ publishSigned"), + releaseStepTask(bintrayRelease), + setNextVersion, + commitNextVersion, + pushChanges +) From 117c11917d74294aac646d00523e7d65ad23b48c Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 15:00:18 +0800 Subject: [PATCH 10/13] Setting version to 1.1.0 --- version.sbt | 1 + 1 file changed, 1 insertion(+) create mode 100644 version.sbt 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" From 5495fc220e89bb2603c409ac12d2c5c2248f0c6e Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 15:04:47 +0800 Subject: [PATCH 11/13] Fix releaseProcess --- release.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.sbt b/release.sbt index 65d17bc..379e4cf 100644 --- a/release.sbt +++ b/release.sbt @@ -8,7 +8,7 @@ releaseProcess := Seq[ReleaseStep]( setReleaseVersion, commitReleaseVersion, tagRelease, - releaseStepCommandAndRemaining("^ publishSigned"), + releaseStepCommandAndRemaining("^ publish"), releaseStepTask(bintrayRelease), setNextVersion, commitNextVersion, From 6f8957046685189c96bb877b26dea7f9f04363e1 Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 15:27:22 +0800 Subject: [PATCH 12/13] Add bintrayPackageLabels --- publish.sbt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/publish.sbt b/publish.sbt index f814077..527116c 100644 --- a/publish.sbt +++ b/publish.sbt @@ -1,4 +1,7 @@ publishMavenStyle := false bintrayRepository := "sbt-plugins" + +bintrayPackageLabels := Seq("sbt", "sbt-plugin", "sbt-test", "scripted", "scripted-plugin", "scalatest") + bintrayReleaseOnPublish := false From 441c34646395c391378b0834e479df7d67217b7d Mon Sep 17 00:00:00 2001 From: Daniel Shuy Date: Sat, 10 Nov 2018 15:29:00 +0800 Subject: [PATCH 13/13] Remove version from build.sbt (defined in version.sbt) --- build.sbt | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.sbt b/build.sbt index a8964b8..ab32416 100644 --- a/build.sbt +++ b/build.sbt @@ -4,8 +4,6 @@ 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"))