I am trying to use the play2-scalate plugin (https://github.com/adetante/play2-scalate) to leverage Jade templates in my Play framework app, but have encountered an error when trying to run 'play publish-local'.
Before I file an issue, I thought I'd check here to see if there may be an easy fix (I'm new to Play/Scala/Scalate). Thanks in advance for any help you can provide.
Versions: Play 2.1-RC1, sbt 0.12.0, scala-2.10.0
instructions are to run play > publish-local
in the project-core directory, and here is the error I get:
[info] Generating Scala API documentation for main sources to /tools/play2-scalate/project-code/target/scala-2.10/api...
[error] /tools/play2-scalate/project-code/app/controllers/Template.scala:21: not enough arguments for constructor TemplateEngine: (sourceDirectories: Traversable[java.io.File], mode: String)org.fusesource.scalate.TemplateEngine
[error] /tools/play2-scalate/project-code/app/controllers/Template.scala:21: not enough arguments for constructor TemplateEngine: (sourceDirectories: Traversable[java.io.File], mode: String)org.fusesource.scalate.TemplateEngine
[error] val engine:TemplateEngine=new TemplateEngine()
[error] val engine:TemplateEngine=new TemplateEngine()
[error] ^
[error] ^
[info] No documentation generated with unsucessful compiler run
[error] one error found
[error] one error found
[error] (compile:doc) Scaladoc generation failed
It looks like it is failing on a documentation generation step; I am not sure how to get around this. Any advice is appreciated. Thanks!
It appears as though there is a binary incompatibility with libraries built w/ scala 2.9 and 2.10 regarding default parameters; see: Scala 2.10.0 RC2 and optional parameters
The solution was to modify the project-code/project/Build.scala
to set the scalate dependency to "scalate-core_2.10" % "1.6.1"
resulting in:
object ApplicationBuild extends Build {
val appName = "play2-scalate"
val appVersion = "0.1-SNAPSHOT"
val appDependencies = Seq(
"org.fusesource.scalate" % "scalate-core_2.10" % "1.6.1"
)
val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
)
}
There were other changes to the /project
files that needed to be made:
/project-code/project/build.properties
-sbt.version=0.11.2
+sbt.version=0.12.2
/project-code/project/plugins.sbt
// Use the Play sbt plugin for Play projects
-addSbtPlugin("play" % "sbt-plugin" % "2.0.1")
+addSbtPlugin("play" % "sbt-plugin" % "2.1.0")
Hope this helps.