Add shadow plugin to create uber JAR
Some checks failed
Pull Request / build (pull_request) Failing after 3m11s

This commit is contained in:
Marvin Elsen 2024-11-05 12:01:23 +01:00
parent baa4b9bd1a
commit 8976165b27
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2
4 changed files with 20 additions and 1 deletions

View File

@ -2,7 +2,9 @@ plugins {
alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization) alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.detekt) alias(libs.plugins.detekt)
alias(libs.plugins.shadow)
alias(libs.plugins.jfx) alias(libs.plugins.jfx)
java
} }
group = "com.marvinelsen" group = "com.marvinelsen"
@ -55,3 +57,10 @@ detekt {
allRules = false allRules = false
autoCorrect = true autoCorrect = true
} }
tasks.jar {
manifest {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
attributes["Main-Class"] = "com.marvinelsen.willow.MainKt"
}
}

View File

@ -1,6 +1,7 @@
[versions] [versions]
kotlin = "2.0.20" kotlin = "2.0.20"
detekt = "1.23.7" detekt = "1.23.7"
shadow = "8.3.5"
jfx-plugin = "0.1.0" jfx-plugin = "0.1.0"
javafx = "23" javafx = "23"
@ -50,4 +51,8 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi
# See: https://detekt.dev # See: https://detekt.dev
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
# Gradle Shadow
# See: https://gradleup.com/shadow/
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
jfx = { id = "org.openjfx.javafxplugin", version.ref = "jfx-plugin" } jfx = { id = "org.openjfx.javafxplugin", version.ref = "jfx-plugin" }

View File

@ -0,0 +1,5 @@
package com.marvinelsen.willow
fun main(args: Array<String>) {
actualMain(args)
}

View File

@ -85,6 +85,6 @@ class WillowApplication : Application() {
} }
@Suppress("SpreadOperator") @Suppress("SpreadOperator")
fun main(args: Array<String>) { fun actualMain(args: Array<String>) {
Application.launch(WillowApplication::class.java, *args) Application.launch(WillowApplication::class.java, *args)
} }