Skip to content

Update sbt-web, JS engine, CoffeeScript #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 3 additions & 29 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,33 +1,7 @@
sbtPlugin := true

organization := "com.typesafe.sbt"

name := "sbt-coffeescript"

version := "1.0.1-SNAPSHOT"

scalaVersion := "2.10.4"

scalacOptions += "-feature"

libraryDependencies ++= Seq(
"org.webjars" % "coffee-script-node" % "1.7.1",
"org.webjars" % "mkdirp" % "0.3.5"
"org.webjars" % "coffee-script-node" % "1.11.0",
"org.webjars" % "mkdirp" % "0.5.0"
)

resolvers ++= Seq(
"Typesafe Releases Repository" at "http://repo.typesafe.com/typesafe/releases/"
)

addSbtPlugin("com.typesafe.sbt" % "sbt-js-engine" % "1.2.0")

publishMavenStyle := false

publishTo := {
if (isSnapshot.value) Some(Classpaths.sbtPluginSnapshots)
else Some(Classpaths.sbtPluginReleases)
}

scriptedSettings

scriptedLaunchOpts <+= version apply { v => s"-Dproject.version=$v" }
addSbtJsEngine("1.2.1")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.15
4 changes: 1 addition & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
libraryDependencies <+= (sbtVersion) { sv =>
"org.scala-sbt" % "scripted-plugin" % sv
}
addSbtPlugin("com.typesafe.sbt" % "sbt-web-build-base" % "1.0.0")
2 changes: 1 addition & 1 deletion sbt-coffeescript-plugin-tester/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.15
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,23 @@ object SbtCoffeeScript extends AutoPlugin {
).toString()
)

override def buildSettings = inTask(coffeescript)(
SbtJsTask.jsTaskSpecificUnscopedBuildSettings ++ Seq(
moduleName := "coffeescript",
shellFile := getClass.getClassLoader.getResource("coffee.js")

)
)

override def projectSettings = Seq(
bare := false,
sourceMap := true

) ++ inTask(coffeescript)(
SbtJsTask.jsTaskSpecificUnscopedSettings ++
SbtJsTask.jsTaskSpecificUnscopedProjectSettings ++
inConfig(Assets)(coffeeScriptUnscopedSettings) ++
inConfig(TestAssets)(coffeeScriptUnscopedSettings) ++
Seq(
moduleName := "coffeescript",
shellFile := getClass.getClassLoader.getResource("coffee.js"),

taskMessage in Assets := "CoffeeScript compiling",
taskMessage in TestAssets := "CoffeeScript test compiling"
)
Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-coffeescript-plugin/coffee/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ checkMapFileContents := {
| "a.coffee"
| ],
| "names": [],
| "mappings": "AAAA;AAAA,MAAA,gBAAA;;AAAA,EAAA,MAAA,GAAW,EAAX,CAAA;;AAAA,EACA,QAAA,GAAW,IADX,CAAA;AAAA"
| "mappings": "AAAA;AAAA,MAAA;;EAAA,MAAA,GAAW;;EACX,QAAA,GAAW;AADX"
|}""".stripMargin) {
sys.error(s"Unexpected contents: $contents")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.15
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))

resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
Resolver.sonatypeRepo("snapshots"),
"Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/"
)
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
29 changes: 29 additions & 0 deletions src/sbt-test/sbt-coffeescript-plugin/error-output/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
lazy val root = (project in file(".")).enablePlugins(SbtWeb)

WebKeys.reporter := {
val logFile = target.value / "test-errors.log"
new LoggerReporter(-1, new Logger {

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

def success(message: => String): Unit = {}

def log(level: Level.Value, message: => String): Unit = {
if (level == Level.Error) {
IO.append(logFile, message + "\n")
}
}
})
}

val checkTestErrorLogContents = taskKey[Unit]("check that test log contents are correct")
checkTestErrorLogContents := {
val contents = IO.read(target.value / "test-errors.log")
if (!contents.endsWith("""/src/main/assets/a.coffee:0: unexpected %
|%
|^
|one error found
|""".stripMargin)) {
sys.error(s"Unexpected contents: $contents")
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.15
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))

resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.url("sbt snapshot plugins", url("http://repo.scala-sbt.org/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns),
Resolver.sonatypeRepo("snapshots"),
"Typesafe Snapshots Repository" at "http://repo.typesafe.com/typesafe/snapshots/"
)
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % sys.props("project.version"))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*(U$@QNJH#R)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to change this because it crashed later versions of CoffeeScript!

jashkenas/coffeescript#4575

%
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-coffeescript-plugin/error-output/test
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Compile an less file and see that errors are reported.
-> assets
$ exists target/unrecognised-input-error
> checkTestErrorLogContents
1 change: 1 addition & 0 deletions version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version in ThisBuild := "1.0.1-SNAPSHOT"