From 34bece66228babce5c06790759feb23e9858c99d Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Thu, 5 Mar 2020 09:29:13 +0800 Subject: [PATCH] Graphical: executable JAR --- mirai-console-graphical/build.gradle.kts | 9 ++++++++- .../net/mamoe/mirai/console/graphical/MiraiGraphical.kt | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/mirai-console-graphical/build.gradle.kts b/mirai-console-graphical/build.gradle.kts index d8656417b..46d73f6c8 100644 --- a/mirai-console-graphical/build.gradle.kts +++ b/mirai-console-graphical/build.gradle.kts @@ -13,6 +13,13 @@ javafx { apply(plugin = "com.github.johnrengelman.shadow") +tasks.withType() { + manifest { + attributes["Main-Class"] = "net.mamoe.mirai.console.graphical.MiraiGraphicalLoader" + } +} + + val kotlinVersion: String by rootProject.ext val atomicFuVersion: String by rootProject.ext val coroutinesVersion: String by rootProject.ext @@ -41,4 +48,4 @@ dependencies { tasks.withType { kotlinOptions.jvmTarget = "1.8" -} \ No newline at end of file +} diff --git a/mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/MiraiGraphical.kt b/mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/MiraiGraphical.kt index 51e61f081..8d1f7375c 100644 --- a/mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/MiraiGraphical.kt +++ b/mirai-console-graphical/src/main/kotlin/net/mamoe/mirai/console/graphical/MiraiGraphical.kt @@ -17,8 +17,11 @@ import tornadofx.App import tornadofx.find import tornadofx.launch -fun main(args: Array) { - launch(args) +object MiraiGraphicalLoader { + @JvmStatic + fun main(args: Array) { + launch(args) + } } class MiraiGraphicalUI : App(Decorator::class, PrimaryStyleSheet::class) {