aboutsummaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'app/build.gradle')
-rw-r--r--app/build.gradle46
1 files changed, 41 insertions, 5 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 9d46a4d..dec3174 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,6 +6,15 @@
* User Manual available at https://docs.gradle.org/8.0.2/userguide/building_java_projects.html
*/
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'io.github.fvarrui:javapackager:1.7.2'
+ }
+}
+
plugins {
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
id 'org.jetbrains.kotlin.jvm' version '1.8.0'
@@ -17,6 +26,8 @@ plugins {
id 'distribution'
}
+apply plugin: 'io.github.fvarrui.javapackager.plugin'
+
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
@@ -43,28 +54,53 @@ dependencies {
application {
// Define the main class for the application.
mainClass = 'xyz.brysonsteck.servercraft.MainKt'
+ applicationName = "ServerCraft"
}
distTar {
compression = Compression.GZIP
- archiveFileName = 'ServerCraft.tar.gz'
-}
-
-distZip {
- archiveFileName = 'ServerCraft.zip'
}
jar {
archiveFileName = 'ServerCraft.jar'
+
manifest {
attributes 'Main-Class': application.mainClass
}
+
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
+task pack(type: io.github.fvarrui.javapackager.gradle.PackageTask, dependsOn: build) {
+ mainClass = 'xyz.brysonsteck.servercraft.MainKt'
+ bundleJre = true
+ generateInstaller = true
+ administratorRequired = false
+
+ linuxConfig {
+ pngFile = 'file:app/src/main/resources/icon.png'
+ }
+
+ macConfig {
+ icnsFile = app/src/main/resources/icon.icns
+ volumeIcon = 'app/src/main/resources/icon.icns'
+ backgroundImage = 'app/src/main/resources/dmg.png'
+ developerId = 'Bryson Steck'
+ appId = 'xyz.brysonsteck.ServerCraft'
+ }
+
+ winConfig {
+ icoFile = app/src/main/resources/icon.ico
+ setupMode = 'askTheUser'
+ disableDirPage = false
+ disableFinishedPage = false
+ disableWelcomePage = false
+ }
+}
+
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()