sbt-scalate-plugin -> SBT 0.10.0

30 views
Skip to first unread message

Keith Irwin

unread,
Jun 9, 2011, 5:38:05 PM6/9/11
to sca...@googlegroups.com
Hi--

Here's one possible sbt-scalate-plugin for SBT 0.10.0 (more an example than anything else):


Rather than use the precompiler, this version adds a source-generator task that SBT invokes before compiling sources.

The advantage is that the SBT compile task compiles both the scalate generated sources and the application sources at the same time so dependent objects used in your templates get checked.

The disadvantage is that SBT can't tell that a given application object necessitates that a template needs recompiling, or that the generated source is out of date. Maybe there's a way to add the generated_source to whatever it is that does this sort of analysis?

I don't know if the precompiler is any better. If not, then I think I can add some more tasks to the above plugin to "scalate-clean" or some such thing so that you can manually recompile the whole wad if you want without deleting already-compiled application code. Might be nice to add a setting for toggling precompilation, too. (I always use it just for type checking if nothing else.)

I expect you all, or James? will redo this to be more idiomatic given your knowledge of how people want to interact with template compilation day-to-day. I look forward to using your new version, if you do!

Hope this helps.

Keith

Keith Irwin

unread,
Jun 10, 2011, 8:48:14 PM6/10/11
to sca...@googlegroups.com
If anyone's interested, I created an SBT 0.10.0 plugin for precompiling templates:


Keith
Reply all
Reply to author
Forward
0 new messages