diff --git a/build.gradle.kts b/build.gradle.kts index 5b42fe1..a9259e9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,7 +2,9 @@ plugins { alias(libs.plugins.kotlin.jvm) alias(libs.plugins.kotlin.serialization) alias(libs.plugins.detekt) + alias(libs.plugins.shadow) alias(libs.plugins.jfx) + java } group = "com.marvinelsen" @@ -55,3 +57,10 @@ detekt { allRules = false autoCorrect = true } + +tasks.jar { + manifest { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + attributes["Main-Class"] = "com.marvinelsen.willow.MainKt" + } +} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f180b1b..fb76cf0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] kotlin = "2.0.20" detekt = "1.23.7" +shadow = "8.3.5" jfx-plugin = "0.1.0" javafx = "23" @@ -50,4 +51,8 @@ kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", versi # See: https://detekt.dev 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" } diff --git a/src/main/kotlin/com/marvinelsen/willow/Main.kt b/src/main/kotlin/com/marvinelsen/willow/Main.kt new file mode 100644 index 0000000..ef3999e --- /dev/null +++ b/src/main/kotlin/com/marvinelsen/willow/Main.kt @@ -0,0 +1,5 @@ +package com.marvinelsen.willow + +fun main(args: Array) { + actualMain(args) +} \ No newline at end of file diff --git a/src/main/kotlin/com/marvinelsen/willow/WillowApplication.kt b/src/main/kotlin/com/marvinelsen/willow/WillowApplication.kt index 5960cd7..118c31c 100644 --- a/src/main/kotlin/com/marvinelsen/willow/WillowApplication.kt +++ b/src/main/kotlin/com/marvinelsen/willow/WillowApplication.kt @@ -85,6 +85,6 @@ class WillowApplication : Application() { } @Suppress("SpreadOperator") -fun main(args: Array) { +fun actualMain(args: Array) { Application.launch(WillowApplication::class.java, *args) }