From f5165f7d77e5756c8efc2e54488313e11fe0882a Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 15 Jun 2020 11:13:15 +0800 Subject: [PATCH] Add Manifest; Disabling SwingSolver with vm property `mirai.no-desktop` (#362) * Disabling SwingSolver with vm property 'mirai.no-desktop' // for ssh // java -Dmirai.no-desktop .... * Add Manifest * Removed Per-Entry Attributes Co-authored-by: Him188 --- README.md | 1 + build.gradle.kts | 8 ++++++++ .../kotlin/net/mamoe/mirai/utils/WindowHelperJvm.kt | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4342a31c..7fc4adf89 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,7 @@ Demos: [mirai-demos](https://github.com/mamoe/mirai-demos) - 酷Q的插件可以在 mirai 中加载, 详见 [Mirai-Native](https://github.com/iTXTech/mirai-native) - 使用 `酷Q HTTP API` 的插件将可以在 mirai 中加载,`Mirai-CQ-Adapter` 正在进行中 + ## [贡献](CONTRIBUTING.md) 我们欢迎一切形式的贡献。 diff --git a/build.gradle.kts b/build.gradle.kts index bbab403ef..bb20375bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -93,6 +93,14 @@ subprojects { file.name.endsWith(".sf", ignoreCase = true) .also { if (it) println("excluded ${file.name}") } } + this.manifest { + this.attributes( + "Manifest-Version" to 1, + "Implementation-Vendor" to "Mamoe Technologies", + "Implementation-Title" to this@afterEvaluate.name.toString(), + "Implementation-Version" to this@afterEvaluate.version.toString() + ) + } } val githubUpload by tasks.creating { diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/WindowHelperJvm.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/WindowHelperJvm.kt index 1de87c9f7..29e2873ab 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/WindowHelperJvm.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/WindowHelperJvm.kt @@ -28,7 +28,7 @@ import javax.swing.SwingUtilities internal object WindowHelperJvm { internal val isDesktopSupported: Boolean = kotlin.runCatching { - Desktop.isDesktopSupported() + System.getProperty("mirai.no-desktop") === null && Desktop.isDesktopSupported() }.getOrElse { false }