Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
122 lines (106 sloc) 3.27 KB
plugins {
id 'org.jetbrains.kotlin.jvm' version "1.3.41"
id 'org.openjfx.javafxplugin' version '0.0.7'
}
def KOTLIN_VERSION = "1.3.41"
def JAVA_HOME = System.properties['java.home']
// BEGIN YOUR SETUP // e.g. /libs/javafx/12
def JFX_INSTALL = '/Library/Java/javafx/12.0.1'
// END YOUR SETUP
group 'org.epistatic'
version '1.0.0'
repositories {
mavenCentral()
flatDir {
dirs "${JFX_INSTALL}/lib"
}
}
apply plugin: 'application'
mainClassName = 'org.epistatic.app1.Main'
javafx {
modules = [ 'javafx.controls', 'javafx.fxml' ]
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
compile "com.google.guava:guava:27.1-jre"
testCompile "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION"
testCompile "org.assertj:assertj-core:3.11.1"
testCompile "org.testfx:testfx-core:4.0.15-alpha"
testCompile "org.testfx:testfx-junit:4.0.15-alpha"
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
task runApp1(type: JavaExec) {
group = "Application"
description = "Runs Application 1 - Basic JavaFx"
classpath sourceSets.main.runtimeClasspath
main = 'org.epistatic.app1.Main'
doFirst {
jvmArgs = [
'--module-path', "${JFX_INSTALL}/lib",
'--add-modules', 'javafx.fxml,javafx.controls'
]
}
}
task runApp2(type: JavaExec) {
group = "Application"
description = "Runs Application 2 - Drag and Drop"
classpath sourceSets.main.runtimeClasspath
main = 'org.epistatic.app2.Main'
doFirst {
jvmArgs = [
'--module-path', "${JFX_INSTALL}/lib",
'--add-modules', 'javafx.fxml,javafx.controls'
]
}
}
task runApp3(type: JavaExec) {
group = "Application"
description = "Runs Application 3 - Multiple Controllers with Events"
classpath sourceSets.main.runtimeClasspath
main = 'org.epistatic.app3.Main'
doFirst {
jvmArgs = [
'--module-path', "${JFX_INSTALL}/lib",
'--add-modules', 'javafx.fxml,javafx.controls'
]
}
}
task runApp4(type: JavaExec) {
group = "Application"
description = "Runs Application 4 - Nested Controllers"
classpath sourceSets.main.runtimeClasspath
main = 'org.epistatic.app4.Main'
doFirst {
jvmArgs = [
'--module-path', "${JFX_INSTALL}/lib",
'--add-modules', 'javafx.fxml,javafx.controls'
]
}
}
task collateInstall(type:Copy){
delete "installBuild"
mkdir "installBuild/lib"
copy {
from configurations.compile
into "installBuild/lib"
}
copy {
from "build/libs"
into "installBuild"
}
}
task listModules(type: Exec) {
workingDir '.'
commandLine "${JAVA_HOME}/bin/jdeps", '-s', '--module-path', "${JFX_INSTALL}/lib", '--class-path', 'installBuild/lib/*','-recursive', "installBuild/${jar.baseName}-${version}.jar"
}
task buildRuntime(type: Exec) {
delete("installBuild/jre")
def DEP_LIST = file('dependencies.txt').text
workingDir 'installBuild'
commandLine "${JAVA_HOME}/bin/jlink", '--module-path', "${JFX_INSTALL}/jmods", '--strip-debug', '--no-header-files', '--no-man-pages', '--compress=2', '--add-modules', DEP_LIST, '--output', 'jre'
}
You can’t perform that action at this time.