Skip to content

Commit 276bfe8

Browse files
committed
Fix sbt-test to succeed
1 parent de9564e commit 276bfe8

File tree

6 files changed

+19
-8
lines changed

6 files changed

+19
-8
lines changed

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ lazy val root = (project in file("."))
1111
"org.webjars.npm" % "coffeescript" % "2.3.2",
1212
"org.webjars" % "mkdirp" % "0.5.0"
1313
),
14+
scriptedLaunchOpts := { scriptedLaunchOpts.value ++
15+
Seq("-Dplugin.version=" + version.value)
16+
},
1417
publishArtifact in (Compile, packageDoc) := false,
1518
publishArtifact in (Compile, packageSrc) := false,
1619
bintrayRepository := "sbt-plugin-releases",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.15
1+
sbt.version=1.2.8
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
addSbtPlugin("com.github.xenonabe" % "sbt-coffeescript2" % sys.props("project.version"))
1+
sys.props.get("plugin.version") match {
2+
case Some(x) => addSbtPlugin("com.github.xenonabe" % "sbt-coffeescript2" % x)
3+
case _ => sys.error("""|The system property 'plugin.version' is not defined.
4+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
5+
}

src/sbt-test/sbt-coffeescript-plugin/error-output/build.sbt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import sbt.internal.inc.LoggedReporter
2+
13
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
24

35
WebKeys.reporter := {
46
val logFile = target.value / "test-errors.log"
5-
new LoggerReporter(-1, new Logger {
7+
new LoggedReporter(-1, new Logger {
68

79
def trace(t: => Throwable): Unit = {}
810

@@ -19,9 +21,7 @@ WebKeys.reporter := {
1921
val checkTestErrorLogContents = taskKey[Unit]("check that test log contents are correct")
2022
checkTestErrorLogContents := {
2123
val contents = IO.read(target.value / "test-errors.log")
22-
if (!contents.endsWith("""/src/main/assets/a.coffee:0: unexpected %
23-
|%
24-
|^
24+
if (!contents.endsWith("""/src/main/assets/a.coffee:0:0: unexpected %
2525
|one error found
2626
|""".stripMargin)) {
2727
sys.error(s"Unexpected contents: $contents")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.15
1+
sbt.version=1.2.8
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
addSbtPlugin("com.github.xenonabe" % "sbt-coffeescript2" % sys.props("project.version"))
1+
sys.props.get("plugin.version") match {
2+
case Some(x) => addSbtPlugin("com.github.xenonabe" % "sbt-coffeescript2" % x)
3+
case _ => sys.error("""|The system property 'plugin.version' is not defined.
4+
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
5+
}

0 commit comments

Comments
 (0)