Let's make a Javascript (Nashorn) build script engine for Gradle!

(Rob Platt) #1

I was reading the ‘Why Groovy?’ section of the overview of Gradle, and how community efforts to create additional build script engines would be welcome. This gave me an idea…

We could create a Javascript (Nashorn) build script engine for Java 8 projects!

I notice a lot of questions regarding javascript libraries in Gradle. It seems that gradle is of quite some interest to javascript developers. Probably this is largely from Groovy/Grails projects, but with avatar.js (node.js for Java) now open source, and Spring MVC still going strong, there are some interesting opportunities for java+javascript powered by Gradle under the hood.

The ability for the build process to talk javascript also raises some interesting possibilities for integrating js test frameworks, analyzing and post-processing js resources, etc.

We could easily support coffeescript in addition to js; at first this would just load up coffescript.js and use the javascript engine but it could be made more ‘coffeescript-flavoured’ later on. So there is the potential for two new DSLs here.

I’d be interested to know whether there is community interest for me to get this started. Also, any suggestions would be welcome

(Luke Daley) #2

For anyone that stumbles upon this page, the discussion moved to the gradle-dev mailing list.

Thread link: http://gradle.1045684.n5.nabble.com/javascript-nashorn-build-script-engine-for-gradle-td5712364.html