zentrope/xsbt-scalate-precompile-plugin — Issue #4: Templates in the nested directory
Author: takezoe
Created: 2011-10-26 16:44:42+00:00
State: open

xsbt-scalate-precompile-plugin seems to not process nested directories of the inputDir.

For example, the layout template has to be placed into /WEB-INF/scalate/layouts/default.scaml, and it has to be compiled as scalate.layouts package.

At first I specified scalateTemplateDirectories as following:

```scala
scalateTemplateDirectories in Compile <<= (
scalateTemplateDirectories in Compile, baseDirectory) {
(dirs, basedir) => dirs ++ Seq(new File(basedir, "/src/main/webapp/WEB-INF"))
}
```

But xsbt-scalate-precompile-plugin processed only templates in /WEB-INF only. /WEB-INF/scalate/layouts/default.scaml did not be processed.

Next, I added /WEB-INF/scalate/layouts to scalateTemplateDirectories.

```scala
scalateTemplateDirectories in Compile <<= (
scalateTemplateDirectories in Compile, baseDirectory) {
(dirs, basedir) => dirs ++ Seq(
new File(basedir, "/src/main/webapp/WEB-INF"),
new File(basedir, "/src/main/webapp/WEB-INF/scalate/layouts")
)
}
```

Then /WEB-INF/scalate/layouts/default.scaml was compiled as the default package, not scalate.layouts package :-(

This is a serious problem for me because I need pre-compilation of templates from several reasons. Finally, I modified ScalatePlugin because I couldn't find the way to make it using xsbt-scalate-precompile-plugin.

The patch is: https://gist.github.com/1316239

Is there any solution? If there is no solution in the current version of xsbt-scalate-precompile-plugin, I'm glad if you take this patch.

Reagds,