From 2246d906c63bfdde452d1913b1c192fb55cf38e9 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 12 Apr 2020 20:06:04 +0800 Subject: [PATCH 1/2] Update core dependencies --- buildSrc/src/main/kotlin/versions.kt | 2 +- mirai-console-graphical/build.gradle.kts | 5 +++-- mirai-console/build.gradle.kts | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/kotlin/versions.kt b/buildSrc/src/main/kotlin/versions.kt index 2f8b883ae..ed00681bb 100644 --- a/buildSrc/src/main/kotlin/versions.kt +++ b/buildSrc/src/main/kotlin/versions.kt @@ -11,7 +11,7 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope object Versions { object Mirai { - const val core = "0.34.0" + const val core = "0.37.1" const val console = "0.4.8" const val consoleGraphical = "0.0.7" const val consoleWrapper = "0.2.0" diff --git a/mirai-console-graphical/build.gradle.kts b/mirai-console-graphical/build.gradle.kts index f82af1251..c56bcf821 100644 --- a/mirai-console-graphical/build.gradle.kts +++ b/mirai-console-graphical/build.gradle.kts @@ -50,7 +50,7 @@ bintray { } dependencies { - compileOnly("net.mamoe:mirai-core-jvm:${Versions.Mirai.core}") + compileOnly("net.mamoe:mirai-core:${Versions.Mirai.core}") implementation(project(":mirai-console")) api(group = "no.tornado", name = "tornadofx", version = "1.7.19") @@ -59,7 +59,8 @@ dependencies { testApi(project(":mirai-console")) testApi(kotlinx("coroutines-core", Versions.Kotlin.coroutines)) testApi(group = "org.yaml", name = "snakeyaml", version = "1.25") - testApi("net.mamoe:mirai-core-jvm:${Versions.Mirai.core}") + testApi("net.mamoe:mirai-core:${Versions.Mirai.core}") + testApi("net.mamoe:mirai-core-qqandroid:${Versions.Mirai.core}") } tasks.withType { diff --git a/mirai-console/build.gradle.kts b/mirai-console/build.gradle.kts index ca6f8530d..126d48652 100644 --- a/mirai-console/build.gradle.kts +++ b/mirai-console/build.gradle.kts @@ -22,7 +22,7 @@ kotlin { } } dependencies { - compileOnly("net.mamoe:mirai-core-jvm:${Versions.Mirai.core}") + compileOnly("net.mamoe:mirai-core:${Versions.Mirai.core}") compileOnly(kotlin("stdlib")) // embedded by core api("com.google.code.gson:gson:2.8.6") @@ -30,7 +30,7 @@ dependencies { api(group = "com.moandjiezana.toml", name = "toml4j", version = "0.7.2") api("org.jsoup:jsoup:1.12.1") - testApi("net.mamoe:mirai-core-qqandroid-jvm:${Versions.Mirai.core}") + testApi("net.mamoe:mirai-core-qqandroid:${Versions.Mirai.core}") testApi(kotlin("stdlib")) } From 7769183f0231734bff6c20c0adf8ff0ab1df6830 Mon Sep 17 00:00:00 2001 From: PeratX <1215714524@qq.com> Date: Mon, 13 Apr 2020 00:13:57 +0800 Subject: [PATCH 2/2] PluginManager: do not clear plugin seq when reloading --- .../net/mamoe/mirai/console/plugins/PluginManager.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugins/PluginManager.kt b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugins/PluginManager.kt index e4e4a639e..6c7743b7d 100644 --- a/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugins/PluginManager.kt +++ b/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugins/PluginManager.kt @@ -159,7 +159,7 @@ object PluginManager { /** * 尝试加载全部插件 */ - fun loadPlugins() { + fun loadPlugins(clear: Boolean = true) { logger.info("""开始加载${pluginsPath}下的插件""") val findPluginsResult = findPlugins() val pluginsFound = findPluginsResult.pluginsFound @@ -249,8 +249,10 @@ object PluginManager { } - //清掉优先级队列, 来重新填充 - pluginsSequence.clear() + if (clear) { + //清掉优先级队列, 来重新填充 + pluginsSequence.clear() + } pluginsFound.values.forEach { try { @@ -341,7 +343,7 @@ object PluginManager { disablePlugin(it) } } - loadPlugins() + loadPlugins(false) }