fixed AppImage, changed to single app

This commit is contained in:
Bryson Steck 2023-05-17 21:41:04 -06:00
parent 3fbdcaf6cf
commit 9b200a05ef
19 changed files with 22 additions and 8 deletions

View file

@ -6,6 +6,10 @@
* User Manual available at https://docs.gradle.org/8.0.2/userguide/building_java_projects.html * 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 { buildscript {
repositories { repositories {
mavenCentral() mavenCentral()
@ -28,6 +32,8 @@ plugins {
apply plugin: 'io.github.fvarrui.javapackager.plugin' apply plugin: 'io.github.fvarrui.javapackager.plugin'
version = "1.0"
repositories { repositories {
// Use Maven Central for resolving dependencies. // Use Maven Central for resolving dependencies.
mavenCentral() mavenCentral()
@ -62,7 +68,7 @@ distTar {
} }
jar { jar {
archiveFileName = 'ServerCraft.jar' // archiveFileName = 'ServerCraft.jar'
manifest { manifest {
attributes 'Main-Class': application.mainClass attributes 'Main-Class': application.mainClass
@ -83,12 +89,10 @@ task pack(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: bu
organizationUrl = "https://brysonsteck.xyz" organizationUrl = "https://brysonsteck.xyz"
organizationEmail = "me@brysonsteck.xyz" organizationEmail = "me@brysonsteck.xyz"
url = "https://codeberg.org/brysonsteck/ServerCraft" url = "https://codeberg.org/brysonsteck/ServerCraft"
createTarball = true
createZipball = true
additionalResources = [ file('src/main/resources/xyz/brysonsteck/ServerCraft/') ]
linuxConfig { linuxConfig {
pngFile = file('src/main/resources/icon.png') pngFile = file('src/main/resources/icon.png')
wrapJar = false
} }
macConfig { macConfig {
@ -109,11 +113,22 @@ task pack(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: bu
} }
} }
clean.doFirst { // tasks.register('fixAppImageIcon', Copy) {
delete "${rootDir}/app/bin" build.doLast {
delete "${rootDir}/build" 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 { javafx {
version = "20" version = "20"
modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics'] modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics']

View file

@ -8,4 +8,3 @@
*/ */
rootProject.name = 'ServerCraft' rootProject.name = 'ServerCraft'
include('app')

View file

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

View file

Before

Width:  |  Height:  |  Size: 215 KiB

After

Width:  |  Height:  |  Size: 215 KiB

View file

Before

Width:  |  Height:  |  Size: 209 KiB

After

Width:  |  Height:  |  Size: 209 KiB

View file

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 73 KiB

View file

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB