Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
180 lines (158 sloc)
4.84 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'org.jetbrains.kotlin.jvm' version "1.3.61" | |
id 'org.openjfx.javafxplugin' version '0.0.8' | |
} | |
def KOTLIN_VERSION = "1.3.61" | |
def JAVA_HOME = System.properties['java.home'] | |
// BEGIN YOUR SETUP - set location of JFX 13 (or older version) | |
def JFX_VERSION = "13" | |
def JFX_INSTALL = '/Library/Java/javafx/13.0' | |
// END YOUR SETUP | |
group 'org.epistatic' | |
version '2.2.1' | |
repositories { | |
mavenCentral() | |
jcenter() | |
flatDir { | |
dirs "${JFX_INSTALL}/lib" | |
} | |
} | |
apply plugin: 'application' | |
mainClassName = 'org.epistatic.app1.Main' | |
javafx { | |
version = JFX_VERSION | |
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.16-alpha" | |
testCompile "org.testfx:testfx-junit:4.0.16-alpha" | |
testCompile "org.testfx:openjfx-monocle:jdk-12.0.1+2" | |
} | |
compileKotlin { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
compileTestKotlin { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
// tests run in headless mode by default, to watch tests pass in -DshowTests=true on command line | |
test { | |
if (System.getProperty('showTests') != null) | |
systemProperty 'headless', false | |
else | |
systemProperty 'headless', true | |
} | |
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 - Table View Cell Factories" | |
classpath sourceSets.main.runtimeClasspath | |
main = 'org.epistatic.app4.Main' | |
doFirst { | |
jvmArgs = [ | |
'--module-path', "${JFX_INSTALL}/lib", | |
'--add-modules', 'javafx.fxml,javafx.controls' | |
] | |
} | |
} | |
task runApp5(type: JavaExec) { | |
group = "Application" | |
description = "Runs Application 5 - Custom Dialog Demo" | |
classpath sourceSets.main.runtimeClasspath | |
main = 'org.epistatic.app5.Main' | |
doFirst { | |
jvmArgs = [ | |
'--module-path', "${JFX_INSTALL}/lib", | |
'--add-modules', 'javafx.fxml,javafx.controls' | |
] | |
} | |
} | |
task runApp6(type: JavaExec) { | |
group = "Application" | |
description = "Runs Application 6 - Event Handlers" | |
classpath sourceSets.main.runtimeClasspath | |
main = 'org.epistatic.app6.Main' | |
doFirst { | |
jvmArgs = [ | |
'--module-path', "${JFX_INSTALL}/lib", | |
'--add-modules', 'javafx.fxml,javafx.controls' | |
] | |
} | |
} | |
task runApp7(type: JavaExec) { | |
group = "Application" | |
description = "Runs Application 7 - Focus Demo" | |
classpath sourceSets.main.runtimeClasspath | |
main = 'org.epistatic.app7.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/*', "installBuild/${jar.baseName}-${version}.jar" | |
} | |
// Used to create installers only | |
task libs(type: Sync) { | |
from configurations.runtime | |
into "$buildDir/deplibs" | |
} | |
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' | |
} |