mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 23:50:15 +08:00
Fix build
This commit is contained in:
parent
8ea0c538a0
commit
1cf35b8554
@ -65,8 +65,10 @@ object JarPluginLoader : AbstractFilePluginLoader<JvmPlugin, JvmPluginDescriptio
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("RemoveExplicitTypeArguments") // until Kotlin 1.4 NI
|
||||
@Throws(PluginLoadException::class)
|
||||
override fun load(description: JvmPluginDescription): JvmPlugin = description.runCatching {
|
||||
override fun load(description: JvmPluginDescription): JvmPlugin =
|
||||
description.runCatching<JvmPluginDescription, JvmPlugin> {
|
||||
ensureActive()
|
||||
val main = classLoader.loadPluginMainClassByJarFile(name, mainClassName, file).kotlin.run {
|
||||
objectInstance
|
||||
@ -84,7 +86,7 @@ object JarPluginLoader : AbstractFilePluginLoader<JvmPlugin, JvmPluginDescriptio
|
||||
main.internalOnLoad()
|
||||
} else main.onLoad()
|
||||
main
|
||||
}.getOrElse {
|
||||
}.getOrElse<JvmPlugin, JvmPlugin> {
|
||||
throw PluginLoadException("Exception while loading ${description.name}", it)
|
||||
}
|
||||
|
||||
|
@ -12,13 +12,13 @@
|
||||
package net.mamoe.mirai.console.command
|
||||
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.console.plugins.PluginBase
|
||||
import net.mamoe.mirai.console.plugins.builtin.KotlinPlugin
|
||||
import net.mamoe.mirai.message.data.*
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
val plugin: PluginBase = object : PluginBase() {
|
||||
val plugin: KotlinPlugin = object : KotlinPlugin() {
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user