Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9888

Groovyc unable to parse some nonstandard javac compiler options

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.7, 3.0.7
    • None
    • None

    Description

      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: 

      ➜ 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
      

      Looks like the parser handles all javac flags as single values and doesn't allow for flag=>pairs like maxerrsmaxwarns, or stdout (javac 8 docs). 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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            kahlquis Kevan Ahlquist

            Dates

              Created:
              Updated:

              Slack

                Issue deployment