JetBrains / gradle-idea-ext-plugin

Plugin to store IJ settings in gradle script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support 'Override compiler parameters per-module'

rosti-il opened this issue · comments

idea.project.settings {
    compiler {
        javac {
            javacAdditionalOptions "-parameters"
        }
    }
}

This compiler configuration adds javac additional options into the ADDITIONAL_OPTIONS_STRING section of the .idea/compiler.xml file.
Please add an ability to add javac additional options into the ADDITIONAL_OPTIONS_OVERRIDE section as well, i.e. javac additional options per project module.

  <component name="JavacSettings">
    <option name="ADDITIONAL_OPTIONS_STRING" value="-parameters" />
    <option name="ADDITIONAL_OPTIONS_OVERRIDE">
      <module name="some.main" options="-parameters of module" />
    </option>
  </component>

If I understand it right you need just add the missing mapping of the corresponding ADDITIONAL_OPTIONS_OVERRIDE field in the org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions of IntelliJ into the org.jetbrains.gradle.ext.JavacConfiguration of your plugin.

And this is a screenshot of those two parameters in the File -> Settings -> Build -> Compiler -> Java Compiler
image

done. Corresponding IDEA version will be 2020.3 and possibly 2020.2.2