Background
- I'm using Handlebars templates in JavaScript that's part of a SpringMVC 3.x web application.
- Project builds are done using ant.
- Neither Node.js nor Ruby are available on the Linux server.
Problem
- I want to precompile Handlebars templates into JavaScript as part of the build process.
- That is, I don't want to precompile the templates locally and then have to check generated code into source control.
- Without Node.js or Ruby, the server doesn't support the Handlebars npm package nor the Ruby gem, so I can't go the straight-forward route.
Attempts at resolution
Gems-in-a-jar worked well for Compass, but the Handlebars gem relies on native extensions and JRuby doesn't play nice with native extensions and wouldn't build them. I tried a couple of proposed solutions, but had no luck.
Other notes
I looked at Handlebars.java but that seems to be geared more toward using Handlebars templates application-wide, which feels like overkill for my purposes.
I'm looking for a light-weight solution that doesn't create a lot of dependencies and would like to avoid potential maintenance headaches as much as possible.