This week I worked on a Play 2.0 plugin that automatically compiles Roy files. I've named the plugin 'Ray'.
With Ray enabled in your application, you can write a plain
file and place it in the
You can then include it in your page like a normal
Any compile errors will be shown when the page is requested:
Change to your editor to fix up the error:
I couldn't find any prior Play 2.0 plugins so a lot of this was trial and error. In the end, I needed to make this an SBT plugin that is put into the Play 2.0 local Ivy repository.
These were main lines in the
sbtPlugin := true addSbtPlugin("play" % "sbt-plugin" % playVersion) publishTo := Some(playRepository) publishMavenStyle := false
playVersion values are calculated from
environment variables given on the command line:
sbt -Dplay.path=../play-2.0-RC3 -Dplay.version=2.0-RC3 publish
Then the plugin can be added in the application's
addSbtPlugin("org.brianmckenna" % "ray" % "0.1")
And then imported in the application's
Then your Play 2.0 plugin can add resource generators or other build changes.