Graphical: executable JAR

This commit is contained in:
PeratX 2020-03-05 09:29:13 +08:00
parent b6fb0f06ef
commit 34bece6622
2 changed files with 13 additions and 3 deletions

View File

@ -13,6 +13,13 @@ javafx {
apply(plugin = "com.github.johnrengelman.shadow") apply(plugin = "com.github.johnrengelman.shadow")
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>() {
manifest {
attributes["Main-Class"] = "net.mamoe.mirai.console.graphical.MiraiGraphicalLoader"
}
}
val kotlinVersion: String by rootProject.ext val kotlinVersion: String by rootProject.ext
val atomicFuVersion: String by rootProject.ext val atomicFuVersion: String by rootProject.ext
val coroutinesVersion: String by rootProject.ext val coroutinesVersion: String by rootProject.ext
@ -41,4 +48,4 @@ dependencies {
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "1.8"
} }

View File

@ -17,8 +17,11 @@ import tornadofx.App
import tornadofx.find import tornadofx.find
import tornadofx.launch import tornadofx.launch
fun main(args: Array<String>) { object MiraiGraphicalLoader {
launch<MiraiGraphicalUI>(args) @JvmStatic
fun main(args: Array<String>) {
launch<MiraiGraphicalUI>(args)
}
} }
class MiraiGraphicalUI : App(Decorator::class, PrimaryStyleSheet::class) { class MiraiGraphicalUI : App(Decorator::class, PrimaryStyleSheet::class) {