diff --git a/dust/README.md b/dust/README.md index e78c89c..49c3dd4 100644 --- a/dust/README.md +++ b/dust/README.md @@ -1,27 +1,21 @@ # Dust Plugin -This plugin provides build time compilation for [Dust](https://github.com/akdubya/dustjs) templates. - - +This plugin provides build time compilation for the LinkedIn fork of [Dust](https://github.com/linkedin/dustjs) templates. # How to install * add -play 2.0.2: - -```addSbtPlugin("com.typesafe" % "play-plugins-dust" % "1.4")``` +play 2.1: -play 2.0.1: - -```addSbtPlugin("com.typesafe" % "play-plugins-dust" % "1.0-SNAPSHOT")``` +```addSbtPlugin("com.typesafe" % "play-plugins-dust" % "1.5")``` to your plugin.sbt # How to Use -* Include dust. Note that this is not provided by the sbt plugin. It can be found here: [dust-core-0.6.0.min.js](https://raw.github.com/typesafehub/play-plugins/master/dust/sample/public/javascripts/dust-core-0.6.0.min.js) -``` +* Include dust. Note that this is not provided by the sbt plugin. It can be found here: [dust-core-1.2.3.min.js](https://raw.github.com/typesafehub/play-plugins/master/dust/sample/public/javascripts/dust-core-1.2.3.min.js) +``` ``` * Put your dust template .tl files under the ```app/assets``` directory @@ -41,10 +35,27 @@ to your plugin.sbt }); ``` +# Settings + +## dustOutputRelativePath + +Specify path relative to public assets folder to place compiled javascript templates. + +Example: + + DustPlugin.dustOutputRelativePath := "javascripts/templates/" + +## dustNativePath + +Elect to use a native Dust.js compiler (via Node) if installed. + +Example: + + DustPlugin.dustNativePath := Some("/usr/local/shared/npm/bin/dustc") # Sample -For an example, see the bundled sample app +For an example, see the bundled sample app. ## Licence diff --git a/dust/build.sbt b/dust/build.sbt index d5cd918..ff02453 100644 --- a/dust/build.sbt +++ b/dust/build.sbt @@ -4,19 +4,15 @@ sbtPlugin := true name := "play-plugins-dust" -version := "1.4.1-09122012" +version := "1.5" organization := "com.typesafe" -resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" +scalacOptions ++= Seq("-deprecation") -libraryDependencies <++= (scalaVersion) { - case (scalaVersion) => Seq( - sbtPluginExtra("play" % "sbt-plugin" % "2.1-09092012" % "provided", "0.12", scalaVersion) - ) -} +addSbtPlugin("play" % "sbt-plugin" % "2.1-PRODUCTDEV") -libraryDependencies += "commons-io" % "commons-io" % "2.2" +libraryDependencies += "commons-io" % "commons-io" % "2.4" libraryDependencies += "org.specs2" %% "specs2" % "1.12.3" % "test" diff --git a/dust/project/build.properties b/dust/project/build.properties index a8c2f84..5e96e96 100755 --- a/dust/project/build.properties +++ b/dust/project/build.properties @@ -1 +1 @@ -sbt.version=0.12.0 +sbt.version=0.12.4 diff --git a/dust/project/plugins.sbt b/dust/project/plugins.sbt new file mode 100644 index 0000000..f0a2e04 --- /dev/null +++ b/dust/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.2.0") diff --git a/dust/sample/app/controllers/Application.java b/dust/sample/app/controllers/Application.java deleted file mode 100644 index b510bc0..0000000 --- a/dust/sample/app/controllers/Application.java +++ /dev/null @@ -1,25 +0,0 @@ -package controllers; - -import org.codehaus.jackson.node.ObjectNode; - -import play.*; -import play.mvc.*; -import play.libs.*; -import views.html.*; - -public class Application extends Controller { - - public static Result frame() { - return ok(index.render()); - } - - public static Result data() { - ObjectNode json = Json.newObject(); - - json.put("name", "Json"); - json.put("count", 1); - - return ok(json); - } - -} \ No newline at end of file diff --git a/dust/sample/app/controllers/Application.scala b/dust/sample/app/controllers/Application.scala new file mode 100644 index 0000000..7580d7e --- /dev/null +++ b/dust/sample/app/controllers/Application.scala @@ -0,0 +1,21 @@ +package controllers; + +import play.api.mvc._ +import play.api.libs.json._ + +import views.html._ + +object Application extends Controller { + def frame = Action { + Ok(index.render()); + } + + def data() = Action { + val json = Json.obj( + "name" -> "Json", + "count" -> 1 + ) + + Ok(json); + } +} \ No newline at end of file diff --git a/dust/sample/app/views/index.scala.html b/dust/sample/app/views/index.scala.html index a1672f8..3264d8a 100644 --- a/dust/sample/app/views/index.scala.html +++ b/dust/sample/app/views/index.scala.html @@ -6,8 +6,8 @@ Test - - + +