From 47750c506069cd60e9c00b6f86e870a30cd50729 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 20 Sep 2020 18:58:26 +0800 Subject: [PATCH] Add ResolveContext for PluginDependency --- .../console/plugin/description/PluginDependency.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDependency.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDependency.kt index d22883093..25bedabc8 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDependency.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDependency.kt @@ -11,6 +11,8 @@ package net.mamoe.mirai.console.plugin.description +import net.mamoe.mirai.console.compiler.common.ResolveContext +import net.mamoe.mirai.console.compiler.common.ResolveContext.Kind.PLUGIN_ID import net.mamoe.mirai.console.util.SemVersion /** @@ -22,7 +24,7 @@ public data class PluginDependency @JvmOverloads constructor( /** * 依赖插件 ID, [PluginDescription.id] */ - public val id: String, + @ResolveContext(PLUGIN_ID) public val id: String, /** * 依赖版本号. 为 null 时则为不限制版本. * @@ -48,7 +50,10 @@ public data class PluginDependency @JvmOverloads constructor( /** * @see PluginDependency */ - public constructor(name: String, isOptional: Boolean = false) : this( - name, null, isOptional + public constructor( + @ResolveContext(PLUGIN_ID) id: String, + isOptional: Boolean = false, + ) : this( + id, null, isOptional ) } \ No newline at end of file