Add fake constructor for JvmPluginDescription

This commit is contained in:
Him188 2020-09-06 11:44:16 +08:00
parent 4fd379cfec
commit 9add8f71ef

View File

@ -48,4 +48,41 @@ public data class SimpleJvmPluginDescription
init { init {
require(!name.contains(':')) { "':' is forbidden in plugin name" } require(!name.contains(':')) { "':' is forbidden in plugin name" }
} }
} }
@Deprecated(
"JvmPluginDescription 没有构造器. 请使用 SimpleJvmPluginDescription.",
replaceWith = ReplaceWith(
"SimpleJvmPluginDescription(name, version, author, info, dependencies, kind)",
"net.mamoe.mirai.console.plugin.jvm.SimpleJvmPluginDescription"
),
level = DeprecationLevel.WARNING
)
@Suppress("FunctionName")
public fun JvmPluginDescription(
name: String,
version: Semver,
author: String = "",
info: String = "",
dependencies: List<PluginDependency> = listOf(),
kind: PluginKind = PluginKind.NORMAL
): JvmPluginDescription = SimpleJvmPluginDescription(name, version, author, info, dependencies, kind)
@Deprecated(
"JvmPluginDescription 没有构造器. 请使用 SimpleJvmPluginDescription.",
replaceWith = ReplaceWith(
"SimpleJvmPluginDescription(name, version, author, info, dependencies, kind)",
"net.mamoe.mirai.console.plugin.jvm.SimpleJvmPluginDescription"
),
level = DeprecationLevel.WARNING
)
@Suppress("FunctionName")
public fun JvmPluginDescription(
name: String,
version: String,
author: String = "",
info: String = "",
dependencies: List<PluginDependency> = listOf(),
kind: PluginKind = PluginKind.NORMAL
): JvmPluginDescription = SimpleJvmPluginDescription(name, version, author, info, dependencies, kind)