diff --git a/build.gradle b/build.gradle index 0e0679e..4a96e63 100644 --- a/build.gradle +++ b/build.gradle @@ -3,14 +3,16 @@ plugins { id 'application' id 'org.openjfx.javafxplugin' version '0.0.13' id 'dev.hydraulic.conveyor' version '1.4' + id "org.panteleyev.jpackageplugin" version "1.5.2" } import org.gradle.internal.os.OperatingSystem +import org.panteleyev.jpackage.ImageType group 'com.lenis0012' version '1.0' -project.ext.lwjglVersion = "3.3.2-SNAPSHOT" +project.ext.lwjglVersion = "3.3.2" switch (OperatingSystem.current()) { case OperatingSystem.LINUX: project.ext.lwjglNatives = "natives-linux" @@ -29,6 +31,7 @@ repositories { dependencies { implementation 'org.jfxtras:jmetro:11.6.16' implementation 'org.controlsfx:controlsfx:11.1.0' + implementation 'org.eclipse.fx:org.eclipse.fx.drift:1.0.0' implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion") implementation "org.lwjgl:lwjgl" @@ -58,9 +61,9 @@ application { mainModule = 'oraksi' mainClass = 'com.lenis0012.oraksi.HelloApplication' applicationDefaultJvmArgs = [ - '--enable-preview', '--enable-native-access=oraksi', - '--add-opens', - 'javafx.graphics/javafx.scene=oraksi' + '--enable-preview', + '--enable-native-access=oraksi', + '--add-opens=javafx.graphics/javafx.scene=oraksi' ] } @@ -75,3 +78,39 @@ javafx { version = '20' modules = ['javafx.controls', 'javafx.fxml'] } + + +task copyDependencies(type: Copy) { + from configurations.runtimeClasspath + into "build/jmods" +} + +task copyJar(type: Copy) { + from tasks.jar + into "build/jmods" +} + +jpackage { + dependsOn("build", "copyDependencies", "copyJar") + + appName = "Oraksi" + appVersion = project.version.toString() + vendor = "com.lenis0012" + copyright = "Copyright (c) 2023 Lennart ten Wolde" +// runtimeImage = System.getProperty("java.home") + module = "oraksi/com.lenis0012.oraksi.HelloApplication" + modulePaths = ["$buildDir/jmods"] + destination = "$buildDir/dist" + javaOptions = ["-Dfile.encoding=UTF-8", "--enable-preview", "--enable-native-access=oraksi", "--add-opens=javafx.graphics/javafx.scene=oraksi"] + type = ImageType.APP_IMAGE + +// mac { +// icon = "icons/icons.icns" +// } +// +// windows { +// icon = "icons/icons.ico" +// winMenu = true +// winDirChooser = true +// } +} \ No newline at end of file diff --git a/conveyor.conf b/conveyor.conf index 221b41a..0f7ce6b 100644 --- a/conveyor.conf +++ b/conveyor.conf @@ -10,7 +10,7 @@ app { // Windows gets square icons, macOS and Linux icons with rounded corners. icons = { - label = "FX" + label = "Ok" } // Ensure the icons are also included as data files so we can set the window icon. @@ -21,6 +21,19 @@ app { // Check for and apply updates synchronously on every app launch instead of in the background. // Consider removing this line for your own app! updates = aggressive + + jvm { + extract-native-libraries = true + system-properties = { + "org.lwjgl.librarypath" = + "org.lwjgl.util.Debug" = true + } + // Required options because module is converted to jar (https://github.com/hydraulic-software/conveyor/issues/55) + options += "--enable-native-access=ALL-UNNAMED" + options += "--add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED" + } } +; app.windows.console = true + conveyor.compatibility-level = 8