Gradle 1.2 includes support for compiling CoffeeScript but it’s not well documented, there’s nothing on the gradle website and all I was able to find after a bunch of googling was a gradle-dev thread where Luke Daley announces the functionality.
Based on that thread, I was able to come up with this sample gradle file that let me compile my
To integrate this into a war file, you’d need to extend it a little further to make the
war task depend on the
compileCoffee task, and then tell it to include the output in
build/js in the root of the war.
I wasn’t able to use this approach on my current project for a couple of reasons related to restricted maven repos, and ended up using require-cs plugin for require.js AMD module framework as I was already using it.