Features of the JS plugin
You might also want to make sure your code is linted to prevent possible bugs, so I’ve included JSHint support:
There are a bunch of JS documentation tools out there, and I have started by adding support for JSDoc 3
Finally, Nicolas Zakas developed a tool that converts Java properties to JSON or JSON-P called Props2Js:
You can also see detailed tasks usage and options on the Gradle JS project site.
This is the very same process as what I do for this site.
Pros and cons of this tool
Most of the good and the bad come from having tighter JVM integration than tools like Grunt. Gradle can:
- More easily take advantage of tools written in Java, JRuby, Groovy, Scala or other JVM languages.
- There are a bunch of ant tasks already written that Gradle can use out-of-the-box
- Better outputs (like JUnit XML for tests) for Continuous Integration
The limitations and downsides I see are:
- NodeJS integration. There is no reason you can’t run
nodefrom Gradle, but integration won’t be better than strings in and strings out until we have decent Node-JVM integration.
- While Gradle can use ant tasks, Grunt and Maven have a larger set of contributed tasks and scripts because they have larger communities.
- JS developers tend to back away from Groovy/Java tools, even though Gradle is just a DSL.
I strive to build a tool that’s easy to use for many types of developers, yet is as flexible and powerful as I can make it.
- With these new features, I hope to solve JS dependency resolution. I have help from Joshua Newman to include AMD and CommonJS in the next version of the plugin. If you’re interested, you should subscribe to the issues or provide feedback.
- Testing is another gap I hope to close soon. I have plans to incorporate automated testing via Rhino+QUnit/Jasmine/Other and JSTestDriver.
- I’d like to give some automatic benefits to projects that adhere to common conventions like folder structure. We can auto-wire source declarations and configure tasks.
- Finally, source maps is a small but useful and easy-to-implement feature.