Make SimpleJvmPluginDescription internal

This commit is contained in:
Him188 2020-09-20 18:57:10 +08:00
parent e26e98d030
commit 09de9e7cd7

View File

@ -34,6 +34,7 @@ public interface JvmPluginDescription : PluginDescription {
* 构建 [JvmPluginDescription] * 构建 [JvmPluginDescription]
* @see JvmPluginDescriptionBuilder * @see JvmPluginDescriptionBuilder
*/ */
@JvmName("create")
@JvmSynthetic @JvmSynthetic
public operator fun invoke( public operator fun invoke(
/** /**
@ -55,8 +56,7 @@ public interface JvmPluginDescription : PluginDescription {
* 构建 [JvmPluginDescription] * 构建 [JvmPluginDescription]
* @see JvmPluginDescriptionBuilder * @see JvmPluginDescriptionBuilder
*/ */
@Suppress("DEPRECATION_ERROR") @JvmName("create")
@Deprecated("Semver 将会在 1.0-RC 被替换为 Console 自己实现的版本。请临时使用 String。", level = DeprecationLevel.ERROR)
@JvmSynthetic @JvmSynthetic
public operator fun invoke( public operator fun invoke(
/** /**
@ -101,9 +101,8 @@ public class JvmPluginDescriptionBuilder(
private var id: String, private var id: String,
private var version: SemVersion, private var version: SemVersion,
) { ) {
@Suppress("DEPRECATION_ERROR")
public constructor( public constructor(
@ResolveContext(PLUGIN_NAME) id: String, @ResolveContext(PLUGIN_ID) id: String,
@ResolveContext(PLUGIN_VERSION) version: String, @ResolveContext(PLUGIN_VERSION) version: String,
) : this(id, SemVersion(version)) ) : this(id, SemVersion(version))
@ -232,49 +231,19 @@ public class JvmPluginDescriptionBuilder(
* *
* @see JvmPluginDescription * @see JvmPluginDescription
*/ */
@Deprecated( internal data class SimpleJvmPluginDescription
""" @JvmOverloads constructor(
将在 1.0-RC 删除. 请使用 JvmPluginDescription. override val name: String,
""", override val version: SemVersion,
replaceWith = ReplaceWith( override val id: String = name,
"JvmPluginDescription", override val author: String = "",
"net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription" override val info: String = "",
), override val dependencies: Set<PluginDependency> = setOf(),
level = DeprecationLevel.ERROR
)
public data class SimpleJvmPluginDescription
@Deprecated(
"""
构造器不稳定, 将在 1.0-RC 删除. 请使用 JvmPluginDescriptionBuilder.
""",
replaceWith = ReplaceWith(
"JvmPluginDescription(name, version) {}",
"net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription.Companion.invoke"
),
level = DeprecationLevel.ERROR
)
@JvmOverloads public constructor(
public override val name: String,
public override val version: SemVersion,
public override val id: String = name,
public override val author: String = "",
public override val info: String = "",
public override val dependencies: Set<PluginDependency> = setOf(),
) : JvmPluginDescription { ) : JvmPluginDescription {
@Deprecated(
"""
构造器不稳定, 将在 1.0-RC 删除. 请使用 JvmPluginDescriptionBuilder.
""",
replaceWith = ReplaceWith(
"JvmPluginDescription.invoke(name, version) {}",
"net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription.Companion.invoke"
),
level = DeprecationLevel.ERROR
)
@Suppress("DEPRECATION_ERROR") @Suppress("DEPRECATION_ERROR")
@JvmOverloads @JvmOverloads
public constructor( constructor(
name: String, name: String,
version: String, version: String,
id: String = name, id: String = name,