I have a project that contains IntelliJ forms and need to compile it with the javac2 compiler. This used to be done as an Ant task as described here: Ant task for compiling GUI forms (Intellij IDEA)
Is there a way how to replace the standard java compiler with the javac2 compiler in Gradle?
This is the best I could do in Gradle. The Java classes are first compiled and then instrumented by javac2:
configurations {
intellij
}
dependencies {
intellij 'com.intellij:javac2:13'
}
compileJava {
doLast() {
project.ant.taskdef name: 'javac2', classname: 'com.intellij.ant.Javac2', classpath: project.configurations.intellij.asPath
project.ant.javac2 srcdir: project.sourceSets.main.java.srcDirs.join(':'),
includes: 'yourpackage/**/*.form',
classpath: project.sourceSets.main.runtimeClasspath.asPath,
destdir: project.sourceSets.main.output.classesDir,
source: project.sourceCompatibility,
target: project.targetCompatibility,
includeAntRuntime: false,
instrumentnotnull: project.ext.instrument
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With