plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.11'
id 'org.beryx.jlink' version '2.24.1'
}
group 'com.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
ext {
junitVersion = '5.8.2'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
application {
mainModule.set( = 'com.example.fxtest')
mainClass.set( = 'com.example.fxtest.Main')
}
javafx {
version = '17'
modules = ['javafx.controls', 'javafx.fxml']
}
dependencies {
implementation('org.controlsfx:controlsfx:11.1.1')
implementation group: 'org.controlsfx', name: 'controlsfx', version: '11.1.1'
testImplementation("org.junit.jupiter:junit-jupiter-api:${junitVersion}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${junitVersion}")
}
test {
useJUnitPlatform()
}
jlink {
imageZip = project.file("${buildDir}/distributions/app-${javafx.platform.classifier}.zip")
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'app'
}
}
jlinkZip {
group = 'distribution'
}
java {
modularity.inferModulePath.set(true)
}
tasks.named('jar')distributions {
manifestmain {
attributes('Automatic-Module-Name':distributionBaseName 'com.example.fxtest')= 'my-app'
}
}