From 9b200a05ef39c49a718d18829212e3f1fb350b67 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Wed, 17 May 2023 21:41:04 -0600 Subject: [PATCH] fixed AppImage, changed to single app --- app/build.gradle => build.gradle | 29 +++++++++++++----- settings.gradle | 1 - .../kotlin/xyz/brysonsteck/ServerCraft/App.kt | 0 .../xyz/brysonsteck/ServerCraft/Main.kt | 0 .../ServerCraft/controllers/InfoController.kt | 0 .../controllers/PrimaryController.kt | 0 .../ServerCraft/server/Download.kt | 0 .../brysonsteck/ServerCraft/server/Server.kt | 0 {app/src => src}/main/resources/dmg.png | Bin {app/src => src}/main/resources/icon.icns | Bin {app/src => src}/main/resources/icon.ico | Bin {app/src => src}/main/resources/icon.png | Bin .../xyz/brysonsteck/ServerCraft/app.png | Bin .../brysonsteck/ServerCraft/css/info-tabs.css | 0 .../brysonsteck/ServerCraft/icons/info.png | Bin .../brysonsteck/ServerCraft/icons/warning.png | Bin .../xyz/brysonsteck/ServerCraft/info.fxml | 0 .../xyz/brysonsteck/ServerCraft/primary.fxml | 0 .../brysonsteck/serverfordummies/AppTest.kt | 0 19 files changed, 22 insertions(+), 8 deletions(-) rename app/build.gradle => build.gradle (85%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/App.kt (100%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/Main.kt (100%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/InfoController.kt (100%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt (100%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/server/Download.kt (100%) rename {app/src => src}/main/kotlin/xyz/brysonsteck/ServerCraft/server/Server.kt (100%) rename {app/src => src}/main/resources/dmg.png (100%) rename {app/src => src}/main/resources/icon.icns (100%) rename {app/src => src}/main/resources/icon.ico (100%) rename {app/src => src}/main/resources/icon.png (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/app.png (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/css/info-tabs.css (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/icons/info.png (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/icons/warning.png (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/info.fxml (100%) rename {app/src => src}/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml (100%) rename {app/src => src}/test/kotlin/xyz/brysonsteck/serverfordummies/AppTest.kt (100%) diff --git a/app/build.gradle b/build.gradle similarity index 85% rename from app/build.gradle rename to build.gradle index 584f0ab..49bc3d4 100644 --- a/app/build.gradle +++ b/build.gradle @@ -6,6 +6,10 @@ * User Manual available at https://docs.gradle.org/8.0.2/userguide/building_java_projects.html */ +import org.gradle.internal.os.OperatingSystem +import java.nio.file.Files +import java.io.File + buildscript { repositories { mavenCentral() @@ -28,6 +32,8 @@ plugins { apply plugin: 'io.github.fvarrui.javapackager.plugin' +version = "1.0" + repositories { // Use Maven Central for resolving dependencies. mavenCentral() @@ -62,7 +68,7 @@ distTar { } jar { - archiveFileName = 'ServerCraft.jar' + // archiveFileName = 'ServerCraft.jar' manifest { attributes 'Main-Class': application.mainClass @@ -83,12 +89,10 @@ task pack(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: bu organizationUrl = "https://brysonsteck.xyz" organizationEmail = "me@brysonsteck.xyz" url = "https://codeberg.org/brysonsteck/ServerCraft" - createTarball = true - createZipball = true - additionalResources = [ file('src/main/resources/xyz/brysonsteck/ServerCraft/') ] linuxConfig { pngFile = file('src/main/resources/icon.png') + wrapJar = false } macConfig { @@ -109,11 +113,22 @@ task pack(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: bu } } -clean.doFirst { - delete "${rootDir}/app/bin" - delete "${rootDir}/build" +// tasks.register('fixAppImageIcon', Copy) { +build.doLast { + if (OperatingSystem.current().isLinux()) { + exec { + workingDir "${buildDir}" + commandLine "mkdir", "-p", "assets/AppDir" + } + exec { + workingDir "${buildDir}" + commandLine "cp", "resources/main/icon.png", "assets/AppDir/ServerCraft.png" + } + } } +// build.finalizedBy(fixAppImageIcon) + javafx { version = "20" modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics'] diff --git a/settings.gradle b/settings.gradle index 0347dfc..4e1a932 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,4 +8,3 @@ */ rootProject.name = 'ServerCraft' -include('app') diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/App.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/App.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/App.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/App.kt diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/Main.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/Main.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/Main.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/Main.kt diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/InfoController.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/InfoController.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/InfoController.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/InfoController.kt diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Download.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Download.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Download.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Download.kt diff --git a/app/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Server.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Server.kt similarity index 100% rename from app/src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Server.kt rename to src/main/kotlin/xyz/brysonsteck/ServerCraft/server/Server.kt diff --git a/app/src/main/resources/dmg.png b/src/main/resources/dmg.png similarity index 100% rename from app/src/main/resources/dmg.png rename to src/main/resources/dmg.png diff --git a/app/src/main/resources/icon.icns b/src/main/resources/icon.icns similarity index 100% rename from app/src/main/resources/icon.icns rename to src/main/resources/icon.icns diff --git a/app/src/main/resources/icon.ico b/src/main/resources/icon.ico similarity index 100% rename from app/src/main/resources/icon.ico rename to src/main/resources/icon.ico diff --git a/app/src/main/resources/icon.png b/src/main/resources/icon.png similarity index 100% rename from app/src/main/resources/icon.png rename to src/main/resources/icon.png diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/app.png b/src/main/resources/xyz/brysonsteck/ServerCraft/app.png similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/app.png rename to src/main/resources/xyz/brysonsteck/ServerCraft/app.png diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/css/info-tabs.css b/src/main/resources/xyz/brysonsteck/ServerCraft/css/info-tabs.css similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/css/info-tabs.css rename to src/main/resources/xyz/brysonsteck/ServerCraft/css/info-tabs.css diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/icons/info.png b/src/main/resources/xyz/brysonsteck/ServerCraft/icons/info.png similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/icons/info.png rename to src/main/resources/xyz/brysonsteck/ServerCraft/icons/info.png diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/icons/warning.png b/src/main/resources/xyz/brysonsteck/ServerCraft/icons/warning.png similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/icons/warning.png rename to src/main/resources/xyz/brysonsteck/ServerCraft/icons/warning.png diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml b/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml rename to src/main/resources/xyz/brysonsteck/ServerCraft/info.fxml diff --git a/app/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml b/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml similarity index 100% rename from app/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml rename to src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml diff --git a/app/src/test/kotlin/xyz/brysonsteck/serverfordummies/AppTest.kt b/src/test/kotlin/xyz/brysonsteck/serverfordummies/AppTest.kt similarity index 100% rename from app/src/test/kotlin/xyz/brysonsteck/serverfordummies/AppTest.kt rename to src/test/kotlin/xyz/brysonsteck/serverfordummies/AppTest.kt