aboutsummaryrefslogtreecommitdiff
path: root/app/build.gradle
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2023-05-15 20:05:43 -0600
committerBryson Steck <brysonsteck@protonmail.com>2023-05-15 20:05:43 -0600
commitbc65a6a44c5f54f65b559731b2a69894b6badf13 (patch)
treee8295ffa823e03e3286816c601595cbca7b8aee1 /app/build.gradle
parentb7ef7feebb2a384fb6a18baf573d0d8a28cb8421 (diff)
downloadServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar
ServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar.gz
ServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar.bz2
changed package name, added java packager to gradle
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()