From 3a033d2694df3ffd53122a9868a65c7905ca29c7 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Wed, 2 Oct 2024 21:10:17 +0800 Subject: [PATCH] chore: use application plugin instead of MANIFEST attribute --- build.gradle.kts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8a7be25..06f2b14 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { alias(libs.plugins.kotlin) alias(libs.plugins.shadow) + id("application") } val fancyBotVersion: String by project @@ -51,19 +52,15 @@ tasks.jar { enabled = false } -tasks.shadowJar { - manifest { - attributes( - "Main-Class" to "cn.rtast.fancybot.FancyBotKt", - "Manifest-Version" to "1.0" - ) - } -} - tasks.register("deployBot") { val apiKey = System.getenv("MCSM_API_KEY") val apiUrl = System.getenv("MCSM_API_URL") val daemonId = System.getenv("MCSM_DAEMON_ID") val instanceId = System.getenv("MCSM_INSTANCE_ID") MCSMDeploy(apiUrl, apiKey, daemonId, instanceId).deploy(file("build/libs/FancyBot-1.0.0-all.jar")) +} + +application { + mainClass = "cn.rtast.fancybot.FancyBotKt" + applicationName = "FancyBot" } \ No newline at end of file