mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Move JvmPluginDescription.invoke to top-level
This commit is contained in:
parent
1a5355db89
commit
64e535d282
@ -29,13 +29,43 @@ import net.mamoe.mirai.console.util.SemVersion
|
||||
*/
|
||||
public interface JvmPluginDescription : PluginDescription {
|
||||
public companion object {
|
||||
/**
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
@Deprecated(
|
||||
"Use top-level function instead",
|
||||
ReplaceWith("JvmPluginDescription(id, version, block)", "net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription"),
|
||||
DeprecationLevel.ERROR
|
||||
)
|
||||
@JvmName("create")
|
||||
public inline fun invoke(
|
||||
@ResolveContext(PLUGIN_ID) id: String,
|
||||
@ResolveContext(SEMANTIC_VERSION) version: String,
|
||||
@ResolveContext(PLUGIN_NAME) name: String = id,
|
||||
block: JvmPluginDescriptionBuilder.() -> Unit = {},
|
||||
): JvmPluginDescription = error("Shouldn't be called")
|
||||
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
@Deprecated(
|
||||
"Use top-level function instead",
|
||||
ReplaceWith("JvmPluginDescription(id, version, block)", "net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription"),
|
||||
DeprecationLevel.ERROR
|
||||
)
|
||||
@JvmName("create")
|
||||
@JvmSynthetic
|
||||
public inline fun invoke(
|
||||
@ResolveContext(PLUGIN_ID) id: String,
|
||||
version: SemVersion,
|
||||
@ResolveContext(PLUGIN_NAME) name: String = id,
|
||||
block: JvmPluginDescriptionBuilder.() -> Unit = {},
|
||||
): JvmPluginDescription = error("Shouldn't be called")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建 [JvmPluginDescription]
|
||||
* @see JvmPluginDescriptionBuilder
|
||||
*/
|
||||
@JvmName("create")
|
||||
@JvmSynthetic
|
||||
public inline operator fun invoke(
|
||||
@JvmSynthetic
|
||||
public inline fun JvmPluginDescription(
|
||||
/**
|
||||
* @see [PluginDescription.id]
|
||||
*/
|
||||
@ -49,15 +79,14 @@ public interface JvmPluginDescription : PluginDescription {
|
||||
*/
|
||||
@ResolveContext(PLUGIN_NAME) name: String = id,
|
||||
block: JvmPluginDescriptionBuilder.() -> Unit = {},
|
||||
): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build()
|
||||
): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build()
|
||||
|
||||
/**
|
||||
/**
|
||||
* 构建 [JvmPluginDescription]
|
||||
* @see JvmPluginDescriptionBuilder
|
||||
*/
|
||||
@JvmName("create")
|
||||
@JvmSynthetic
|
||||
public inline operator fun invoke(
|
||||
@JvmSynthetic
|
||||
public inline fun JvmPluginDescription(
|
||||
/**
|
||||
* @see [PluginDescription.id]
|
||||
*/
|
||||
@ -71,9 +100,7 @@ public interface JvmPluginDescription : PluginDescription {
|
||||
*/
|
||||
@ResolveContext(PLUGIN_NAME) name: String = id,
|
||||
block: JvmPluginDescriptionBuilder.() -> Unit = {},
|
||||
): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build()
|
||||
}
|
||||
}
|
||||
): JvmPluginDescription = JvmPluginDescriptionBuilder(id, version).apply { name(name) }.apply(block).build()
|
||||
|
||||
/**
|
||||
* [JvmPluginDescription] 构建器.
|
||||
|
Loading…
Reference in New Issue
Block a user