diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDescription.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDescription.kt index 7e90ebe72..8875621f8 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDescription.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/plugin/description/PluginDescription.kt @@ -115,7 +115,7 @@ public interface PluginDescription { * * @see PluginDescription.id */ - public val ID_REGEX: Regex = Regex("""([a-zA-Z]+[a-zA-Z0-9]*)\.([a-zA-Z]+[a-zA-Z0-9]*)""") + public val ID_REGEX: Regex = Regex("""([a-zA-Z]+(?:\.[a-zA-Z0-9]+)*)\.([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)""") /** * 在 [PluginDescription.id] 和 [PluginDescription.name] 中禁止用的完全匹配名称列表. @@ -137,7 +137,7 @@ public interface PluginDescription { checkDependencies(instance.id, instance.dependencies) }.getOrElse { throw IllegalPluginDescriptionException( - "Illegal description. Plugin ${instance.name} (${instance.id})", + "Illegal PluginDescription. Plugin ${instance.name} (${instance.id})", it ) } @@ -173,7 +173,7 @@ public interface PluginDescription { public fun checkPluginName(name: String) { if (name.isBlank()) throw IllegalPluginDescriptionException("Plugin name cannot be blank") val lowercaseName = name.toLowerCase() - FORBIDDEN_ID_NAMES.firstOrNull { it in lowercaseName }?.let { illegal -> + FORBIDDEN_ID_NAMES.firstOrNull { it == lowercaseName }?.let { illegal -> throw IllegalPluginDescriptionException("Plugin name is illegal: '$illegal'.") } } diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 35c61dad8..cafefdb5d 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -9,7 +9,7 @@ object Versions { const val core = "1.2.3" - const val console = "1.0-M4-dev-8" + const val console = "1.0-M4-dev-10" const val consoleGraphical = "0.0.7" const val consoleTerminal = "0.1.0" const val consolePure = console