我有一个包含IntelliJ表单的项目,需要使用javac2编译器进行编译。以前,这是作为Ant任务完成的,如下所述:用于编译GUI表单的Ant任务(Intellij IDEA)
有没有办法用Gradle中的javac2编译器替换标准的Java编译器?
这是我在Gradle中能做的最好的事情。Java类首先被编译,然后由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
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句