[GRADLE-3057] Ability to specify a CompilerConfiguration instance for GroovyCompile task? Created: 31/Mar/14  Updated: 05/Aug/14  Resolved: 05/Aug/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.1-rc-1

Type: Task
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 3


Is it possible to specify a CompilerConfiguration (see [1]http://groovy.codehaus.org/api/org/co...) 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.

[1] http://groovy.codehaus.org/api/org/codehaus/groovy/control/CompilerConfiguration.html

Comment by Gradle Forums [ 31/Mar/14 ]


Comment by Gradle Forums [ 31/Mar/14 ]

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.

Comment by Gradle Forums [ 31/Mar/14 ]

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.

Comment by Gradle Forums [ 31/Mar/14 ]

Exposing --configscript seems the way forward.

Comment by Gradle Forums [ 31/Mar/14 ]

Domo Arigato

Comment by Gradle Forums [ 31/Mar/14 ]

What is the status of this? I'm in the need to specify the -configscript in my Gradle build.

Comment by Gradle Forums [ 31/Mar/14 ]

AFAIK it's not yet supported.

Comment by Gradle Forums [ 31/Mar/14 ]

OK thanks, is there any JIRA issue we can follow to track this?

Comment by Mohit Vora [ 15/May/14 ]

I am trying to blend groovy classes with java classes. It would make a lot of sense to have the ability to do CompileStatic for all groovy compilation. Can someone provide an ETA for this?

Comment by Adam Murdoch [ 05/Aug/14 ]

Can now specify a compiler configuration script for a GroovyCompile task.

Generated at Wed Jun 30 12:38:44 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.