Skip to content

Commit 0f38ef0

Browse files
Merge pull request #18 from richdougherty/version-bump
Update sbt-web, JS engine, CoffeeScript
2 parents fdc84c7 + ca07b49 commit 0f38ef0

File tree

15 files changed

+52
-95
lines changed

15 files changed

+52
-95
lines changed

build.sbt

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
1-
sbtPlugin := true
2-
31
organization := "com.typesafe.sbt"
4-
52
name := "sbt-coffeescript"
6-
7-
version := "1.0.1-SNAPSHOT"
8-
9-
scalaVersion := "2.10.4"
10-
11-
scalacOptions += "-feature"
12-
133
libraryDependencies ++= Seq(
14-
"org.webjars" % "coffee-script-node" % "1.7.1",
15-
"org.webjars" % "mkdirp" % "0.3.5"
4+
"org.webjars" % "coffee-script-node" % "1.11.0",
5+
"org.webjars" % "mkdirp" % "0.5.0"
166
)
17-
18-
resolvers ++= Seq(
19-
"Typesafe Releases Repository" at "http://repo.typesafe.com/typesafe/releases/"
20-
)
21-
22-
addSbtPlugin("com.typesafe.sbt" % "sbt-js-engine" % "1.2.0")
23-
24-
publishMavenStyle := false
25-
26-
publishTo := {
27-
if (isSnapshot.value) Some(Classpaths.sbtPluginSnapshots)
28-
else Some(Classpaths.sbtPluginReleases)
29-
}
30-
31-
scriptedSettings
32-
33-
scriptedLaunchOpts <+= version apply { v => s"-Dproject.version=$v" }
7+
addSbtJsEngine("1.2.1")

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.13
1+
sbt.version=0.13.15

project/plugins.sbt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
libraryDependencies <+= (sbtVersion) { sv =>
2-
"org.scala-sbt" % "scripted-plugin" % sv
3-
}
1+
addSbtPlugin("com.typesafe.sbt" % "sbt-web-build-base" % "1.0.0")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.13
1+
sbt.version=0.13.15

src/main/scala/com/typesafe/sbt/coffeescript/SbtCoffeeScript.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@ object SbtCoffeeScript extends AutoPlugin {
4040
).toString()
4141
)
4242

43+
override def buildSettings = inTask(coffeescript)(
44+
SbtJsTask.jsTaskSpecificUnscopedBuildSettings ++ Seq(
45+
moduleName := "coffeescript",
46+
shellFile := getClass.getClassLoader.getResource("coffee.js")
47+
48+
)
49+
)
50+
4351
override def projectSettings = Seq(
4452
bare := false,
4553
sourceMap := true
4654

4755
) ++ inTask(coffeescript)(
48-
SbtJsTask.jsTaskSpecificUnscopedSettings ++
56+
SbtJsTask.jsTaskSpecificUnscopedProjectSettings ++
4957
inConfig(Assets)(coffeeScriptUnscopedSettings) ++
5058
inConfig(TestAssets)(coffeeScriptUnscopedSettings) ++
5159
Seq(
52-
moduleName := "coffeescript",
53-
shellFile := getClass.getClassLoader.getResource("coffee.js"),
54-
5560
taskMessage in Assets := "CoffeeScript compiling",
5661
taskMessage in TestAssets := "CoffeeScript test compiling"
5762
)

src/sbt-test/sbt-coffeescript-plugin/coffee/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ checkMapFileContents := {
1212
| "a.coffee"
1313
| ],
1414
| "names": [],
15-
| "mappings": "AAAA;AAAA,MAAA,gBAAA;;AAAA,EAAA,MAAA,GAAW,EAAX,CAAA;;AAAA,EACA,QAAA,GAAW,IADX,CAAA;AAAA"
15+
| "mappings": "AAAA;AAAA,MAAA;;EAAA,MAAA,GAAW;;EACX,QAAA,GAAW;AADX"
1616
|}""".stripMargin) {
1717
sys.error(s"Unexpected contents: $contents")
1818
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.13
1+
sbt.version=0.13.15
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
2-
3-
resolvers ++= Seq(
4-
Resolver.mavenLocal,
5-
Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
6-
Resolver.sonatypeRepo("snapshots"),
7-
"Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/"
8-
)
1+
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
lazy val root = (project in file(".")).enablePlugins(SbtWeb)
2+
3+
WebKeys.reporter := {
4+
val logFile = target.value / "test-errors.log"
5+
new LoggerReporter(-1, new Logger {
6+
7+
def trace(t: => Throwable): Unit = {}
8+
9+
def success(message: => String): Unit = {}
10+
11+
def log(level: Level.Value, message: => String): Unit = {
12+
if (level == Level.Error) {
13+
IO.append(logFile, message + "\n")
14+
}
15+
}
16+
})
17+
}
18+
19+
val checkTestErrorLogContents = taskKey[Unit]("check that test log contents are correct")
20+
checkTestErrorLogContents := {
21+
val contents = IO.read(target.value / "test-errors.log")
22+
if (!contents.endsWith("""/src/main/assets/a.coffee:0: unexpected %
23+
|%
24+
|^
25+
|one error found
26+
|""".stripMargin)) {
27+
sys.error(s"Unexpected contents: $contents")
28+
}
29+
}

src/sbt-test/sbt-coffeescript-plugin/error-output/project/TestBuild.scala

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.13
1+
sbt.version=0.13.15
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
2-
3-
resolvers ++= Seq(
4-
Resolver.mavenLocal,
5-
Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
6-
Resolver.sonatypeRepo("snapshots"),
7-
"Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/"
8-
)
1+
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*(U$@QNJH#R)
1+
%
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Compile an less file and see that errors are reported.
22
-> assets
3-
$ exists target/unrecognised-input-error
3+
> checkTestErrorLogContents

version.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version in ThisBuild := "1.0.1-SNAPSHOT"

0 commit comments

Comments
 (0)