Skip to content

Instantly share code, notes, and snippets.

@hypothermic
Created May 1, 2019 15:51
Show Gist options
  • Save hypothermic/5f33d5bb63d8d73521c2e746ba690b18 to your computer and use it in GitHub Desktop.
Save hypothermic/5f33d5bb63d8d73521c2e746ba690b18 to your computer and use it in GitHub Desktop.
IntelliJ IDEA Gradle Java Swing form compilation (build.gradle)
apply plugin: 'java'
apply plugin: 'application'
group 'nl.hypothermic'
version '7.1.90144-RELEASE'
mainClassName = 'nl.hypothermic.xanalyzer.modules.md-main.Main'
sourceCompatibility = 1.7
configurations {
antTask
}
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
antTask 'com.intellij:forms_rt:7.0.3'
antTask group: 'com.intellij', name: 'javac2', version: '7.0.3'
}
task compileJava(overwrite: true, dependsOn: configurations.compile.getTaskDependencyFromProjectDependency(true, 'jar')) {
doLast {
project.sourceSets.main.output.classesDir.mkdirs()
ant.taskdef name: 'javac2', classname: 'com.intellij.ant.Javac2', classpath: configurations.antTask.asPath
ant.javac2 srcdir: project.sourceSets.main.java.srcDirs.join(':'),
classpath: project.sourceSets.main.compileClasspath.asPath,
destdir: project.sourceSets.main.output.classesDir,
source: sourceCompatibility,
target: targetCompatibility,
includeAntRuntime: false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment