[
https://issues.apache.org/jira/browse/GROOVY-9888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-9888:
------------------------------
Component/s: command line processing
> Groovyc unable to parse some nonstandard javac compiler options
> ---------------------------------------------------------------
>
> Key: GROOVY-9888
> URL:
https://issues.apache.org/jira/browse/GROOVY-9888> Project: Groovy
> Issue Type: Bug
> Components: command line processing, Compiler
> Affects Versions: 2.4.7, 3.0.7
> Reporter: Kevan Ahlquist
> Priority: Minor
>
> Hi all,
> It appears Groovyc doesn't handle javac compiler options that have space-delimited args such as *-Xmaxerrs _number_* in joint compilation mode. I discovered this in an Ant project using 2.4.7 but I see the same failure using the 3.0.7 groovyc CLI:
> {noformat}
> ➜ groovyc --version
> Groovy compiler version 3.0.7
> Copyright 2003-2020 The Apache Software Foundation.
http://groovy-lang.org/> ➜ groovyc -FXmaxerrs 1000 Foo.java
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> 1000: 1000 (No such file or directory)
> 1 error
> {noformat}
> Looks like the parser [handles all javac flags as single values|
https://github.com/apache/groovy/blob/master/src/main/java/org/codehaus/groovy/tools/FileSystemCompiler.java#L378] and doesn't allow for flag=>pairs like {{maxerrs}}, {{maxwarns}}, or {{stdout}} ([javac 8 docs|
https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html]). This results in the flag's value being treated as a source file and failing compilation.
> Should these flags be handled? Let me know if you need more info, happy to help.
> Kevan
--
This message was sent by Atlassian Jira
(v8.3.4#803005)