Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
1.6
-
None
-
Groovy 1.6.0, Ant 1.7.1, Java 1.5.0_16, Windows XP.
Description
With Groovy 1.5.1, I used the <groovyc> Ant task with a nested <javac> which has the 'source' and 'target' attributes specified using Ant properties:
<groovyc ...
<javac debug="${javac.debug}" source="${javac.compatibility.source.version}" target="${javac.compatibility.target.version}"/>
</groovyc>
The 'javac.compatibility.source.version' and 'javac.compatibility.target.version' properties are both set to '1.4'. This worked fine in 1.5.1, but upgrading to Groovy 1.6.0 I get the following error:
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Invalid commandline usage for javac.
[groovyc] javac: invalid source release: ${javac.compatibility.source.version}
The properties are set up correctly (<echoproperties/> proves it), but for some reason they're not getting resolved in this particular context. If I convert the Ant script to use AntBuilder within a <groovy> script element, it resolves the problem, e.g.
<groovy>
ant.groovyc( ... ) {
...
javac( debug:properties["javac.debug"], source:properties["javac.compatibility.source.version"], target:properties["javac.compatibility.target.version"] )
}
</groovy>
Attachments
Issue Links
- duplicates
-
GROOVY-3223 Nested javac Ant task does not do property substitution on its attributes
- Closed