Merge remote-tracking branch 'origin/master'

This commit is contained in:
Him188 2020-04-13 18:18:26 +08:00
commit 59ebefb272
2 changed files with 8 additions and 6 deletions

View File

@ -12,7 +12,7 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope
object Versions { object Versions {
object Mirai { object Mirai {
const val core = "0.37.1" const val core = "0.37.1"
const val console = "0.4.8" const val console = "0.4.9"
const val consoleGraphical = "0.0.7" const val consoleGraphical = "0.0.7"
const val consoleWrapper = "0.2.0" const val consoleWrapper = "0.2.0"
} }

View File

@ -159,13 +159,13 @@ object PluginManager {
/** /**
* 尝试加载全部插件 * 尝试加载全部插件
*/ */
fun loadPlugins() { fun loadPlugins(clear: Boolean = true) {
logger.info("""开始加载${pluginsPath}下的插件""") logger.info("""开始加载${pluginsPath}下的插件""")
val findPluginsResult = findPlugins() val findPluginsResult = findPlugins()
val pluginsFound = findPluginsResult.pluginsFound val pluginsFound = findPluginsResult.pluginsFound
val pluginsLocation = findPluginsResult.pluginsLocation val pluginsLocation = findPluginsResult.pluginsLocation
//不仅要解决A->B->C->A, 还要解决A->B->C->A //不仅要解决A->B->C->A, 还要解决A->B->A->A
fun checkNoCircularDepends( fun checkNoCircularDepends(
target: PluginDescription, target: PluginDescription,
needDepends: List<String>, needDepends: List<String>,
@ -249,8 +249,10 @@ object PluginManager {
} }
//清掉优先级队列, 来重新填充 if (clear) {
pluginsSequence.clear() //清掉优先级队列, 来重新填充
pluginsSequence.clear()
}
pluginsFound.values.forEach { pluginsFound.values.forEach {
try { try {
@ -341,7 +343,7 @@ object PluginManager {
disablePlugin(it) disablePlugin(it)
} }
} }
loadPlugins() loadPlugins(false)
} }