'Groovy CompilerScript and Intellij

I have a Gradle multi-module project where each module have a CompilerScript.groovy similar to this:

import groovy.transform.CompileStatic

withConfig(configuration) {
    ast(CompileStatic)
    imports {
        star('jakarta.inject')
    }
}

Each Gradle module is configured to read this file and it works as expected.

compileGroovy.groovyOptions.configurationScript = file('src/compiler/groovy/CompilerConfig.groovy')

But IntelliJ show errors inside editor about missing import statements. There is a way to configure the Idea Gradle Plugin with the same configs as Gradle? Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source