I played around with using the coffee.exe from github. This approach worked, but as our conversion of files and lines grew so did the compile time. We needed something smarter that could inspect files and skip unmodified files.
I decided to fork and update the project. In doing so I also learned a bit about creating custom ant tasks. Hopefully anyone else out there who is using ant and wants to use CoffeeScript finds this helpful. A huge thanks to Patrick Mueller for creating this project. With a few small tweaks it has become essential in our JS->CS migration.
Here is the 0.1.6 Change Log:
0.1.6 – 2012/11/26
- Updated to CoffeeScript 1.4.0
- Changed Task for
MatchingTaskso we can add a boolean flag to optionally inherit directory nesting. The new flag is called
noWrapto the new
bareparam for coffee-script compiler.
- Added download directory containing versioned jars.
You can get more details at https://github.com/ctoestreich/CoffeeScriptAntTasks. The latest 0.1.6 jar can be found in the downloads directory of the project or the downloads section of github.