Java compiler plugin?
I'm developing the Gosu language IntelliJ plugin. There is a new feature in development where Gosu can fully interoperate with Java i.e., Java can extend, implement, and use Gosu types. Part of this new feature is a replacement for javac; the gosuc command line compiler compiles both Gosu and Java sources.
My question is, what is the best way for our plugin to make IntelliJ use gosuc and not javac to compile Java sources?
Thanks!
Please sign in to leave a comment.
Hi Scott,
You can examine the code of the JetGroovy plugin bundled with IDEA. This plugin supports groovy-eclipse compiler which takes care about both groovy and java files similar to your situation.
Apart from implementing your own Builder which will be running in the build process (JPS), your IDE-side code should implement and register your own
com.intellij.compiler.impl.javaCompiler.BackendCompiler (see GreclipseIdeaCompiler class for example of how JetGroovy plugin achieves this).
After that your compiler will appear in "File | Settings | Build, Execution, Deployment | Compiler | Java Compiler | Use compiler" option.
Choosing your compiler there will automatically turn off built-in JavaBuilder in the JPS process.