Is it possible to specify a CompilerConfiguration (see http://groovy.codehaus.org/api/org/codehaus/groovy/control/CompilerConfiguration.html) on a GroovyCompile task? I’m mostly interesed in having access to addCompilerCustomizer() It would be great if thise feature could be specified globally (for all GroovyCompile tasks in the project) and overriden locally by SourceSet.
Gradle doesn’t have any specific support for ‘CompilerConfiguration’. Given that Gradle itself may use a different Groovy version, and that compilation typically happens in a separate VM, it’s not quite clear to me how this should be implemented. Maybe something to discuss at the Groovy developer meeting in London this week.
Actually, Groovy 2.1 introduced a ‘–configscript’ option, and it should be relatively straightforward to support that. What’s really missing is a generic way to pass command-line options to the Groovy compiler.