From 6f67a41b5c817dc28c21f9d17fafe00f062fabb4 Mon Sep 17 00:00:00 2001 From: Him188 Date: Thu, 17 Feb 2022 17:45:31 +0000 Subject: [PATCH] Ignore `ConsoleFrontEndImplementation` on apiDump --- .../binary-compatibility-validator-build.txt | 1 + .../compatibility-validation/jvm/api/jvm.api | 76 +------------------ .../src/MiraiConsoleImplementation.kt | 2 + 3 files changed, 4 insertions(+), 75 deletions(-) diff --git a/buildSrc/src/main/resources/binary-compatibility-validator-build.txt b/buildSrc/src/main/resources/binary-compatibility-validator-build.txt index 6dea39119..533408b6a 100644 --- a/buildSrc/src/main/resources/binary-compatibility-validator-build.txt +++ b/buildSrc/src/main/resources/binary-compatibility-validator-build.txt @@ -25,6 +25,7 @@ apiValidation { nonPublicMarkers.add("net.mamoe.mirai.utils.MiraiInternalApi") nonPublicMarkers.add("net.mamoe.mirai.utils.MiraiInternalFile") nonPublicMarkers.add("net.mamoe.mirai.console.util.ConsoleInternalApi") + nonPublicMarkers.add("net.mamoe.mirai.console.ConsoleFrontEndImplementation") // added on 2.11 nonPublicMarkers.add("net.mamoe.mirai.console.util.ConsoleExperimentalApi") nonPublicMarkers.add("net.mamoe.mirai.utils.MiraiExperimentalApi") } \ No newline at end of file diff --git a/mirai-console/backend/mirai-console/compatibility-validation/jvm/api/jvm.api b/mirai-console/backend/mirai-console/compatibility-validation/jvm/api/jvm.api index 057d66516..60136b41c 100644 --- a/mirai-console/backend/mirai-console/compatibility-validation/jvm/api/jvm.api +++ b/mirai-console/backend/mirai-console/compatibility-validation/jvm/api/jvm.api @@ -1,6 +1,3 @@ -public abstract interface annotation class net/mamoe/mirai/console/ConsoleFrontEndImplementation : java/lang/annotation/Annotation { -} - public final class net/mamoe/mirai/console/MalformedMiraiConsoleImplementationError : java/lang/Error { public fun ()V public fun (Ljava/lang/String;)V @@ -13,7 +10,7 @@ public abstract interface class net/mamoe/mirai/console/MiraiConsole : kotlinx/c public abstract fun getBuildDate ()Ljava/time/Instant; public abstract fun getBuiltInPluginLoaders ()Ljava/util/List; public abstract fun getMainLogger ()Lnet/mamoe/mirai/utils/MiraiLogger; - public abstract fun getPluginCenter ()Lnet/mamoe/mirai/console/plugin/center/PluginCenter; + public fun getPluginCenter ()Lnet/mamoe/mirai/console/plugin/center/PluginCenter; public abstract fun getPluginManager ()Lnet/mamoe/mirai/console/plugin/PluginManager; public abstract fun getRootPath ()Ljava/nio/file/Path; public abstract fun getVersion ()Lnet/mamoe/mirai/console/util/SemVersion; @@ -44,77 +41,6 @@ public abstract interface class net/mamoe/mirai/console/MiraiConsoleFrontEndDesc public fun render ()Ljava/lang/String; } -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation : kotlinx/coroutines/CoroutineScope { - public static final field Companion Lnet/mamoe/mirai/console/MiraiConsoleImplementation$Companion; - public abstract fun createLogger (Ljava/lang/String;)Lnet/mamoe/mirai/utils/MiraiLogger; - public abstract fun createLoginSolver (JLnet/mamoe/mirai/utils/BotConfiguration;)Lnet/mamoe/mirai/utils/LoginSolver; - public fun getBackendAccess ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation$BackendAccess; - public abstract fun getBuiltInPluginLoaders ()Ljava/util/List; - public abstract fun getCommandManager ()Lnet/mamoe/mirai/console/command/CommandManager; - public abstract fun getConfigStorageForBuiltIns ()Lnet/mamoe/mirai/console/data/PluginDataStorage; - public abstract fun getConfigStorageForJvmPluginLoader ()Lnet/mamoe/mirai/console/data/PluginDataStorage; - public abstract fun getConsoleCommandSender ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleCommandSenderImpl; - public abstract fun getConsoleDataScope ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope; - public abstract fun getConsoleInput ()Lnet/mamoe/mirai/console/util/ConsoleInput; - public fun getConsoleLaunchOptions ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleLaunchOptions; - public abstract fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext; - public abstract fun getDataStorageForBuiltIns ()Lnet/mamoe/mirai/console/data/PluginDataStorage; - public abstract fun getDataStorageForJvmPluginLoader ()Lnet/mamoe/mirai/console/data/PluginDataStorage; - public abstract fun getFrontEndDescription ()Lnet/mamoe/mirai/console/MiraiConsoleFrontEndDescription; - public static fun getInstance ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation; - public abstract fun getJvmPluginLoader ()Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginLoader; - public fun getLoggerController ()Lnet/mamoe/mirai/console/logging/LoggerController; - public abstract fun getRootPath ()Ljava/nio/file/Path; - public fun isAnsiSupported ()Z - public fun postPhase (Ljava/lang/String;)V - public fun postStart ()V - public fun prePhase (Ljava/lang/String;)V - public fun preStart ()V - public static fun start (Lnet/mamoe/mirai/console/MiraiConsoleImplementation;)V -} - -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation$BackendAccess { - public fun createDefaultCommandManager (Lkotlin/coroutines/CoroutineContext;)Lnet/mamoe/mirai/console/command/CommandManager; - public fun createDefaultJvmPluginLoader (Lkotlin/coroutines/CoroutineContext;)Lnet/mamoe/mirai/console/plugin/jvm/JvmPluginLoader; - public abstract fun getGlobalComponentStorage ()Lnet/mamoe/mirai/console/extension/ComponentStorage; - public abstract fun getResolvedPlugins ()Ljava/util/List; -} - -public final class net/mamoe/mirai/console/MiraiConsoleImplementation$Companion { - public final fun getInstance ()Lnet/mamoe/mirai/console/MiraiConsoleImplementation; - public final fun start (Lnet/mamoe/mirai/console/MiraiConsoleImplementation;)V -} - -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleCommandSenderImpl { - public abstract synthetic fun sendMessage (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract synthetic fun sendMessage (Lnet/mamoe/mirai/message/data/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -} - -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope { - public static final field Companion Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope$Companion; - public abstract fun addAndReloadConfig (Lnet/mamoe/mirai/console/data/PluginConfig;)V - public static fun createDefault (Lkotlin/coroutines/CoroutineContext;Lnet/mamoe/mirai/console/data/PluginDataStorage;Lnet/mamoe/mirai/console/data/PluginDataStorage;)Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope; - public abstract fun getConfigHolder ()Lnet/mamoe/mirai/console/data/AutoSavePluginDataHolder; - public abstract fun getDataHolder ()Lnet/mamoe/mirai/console/data/AutoSavePluginDataHolder; - public abstract fun reloadAll ()V -} - -public final class net/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope$Companion { - public final fun createDefault (Lkotlin/coroutines/CoroutineContext;Lnet/mamoe/mirai/console/data/PluginDataStorage;Lnet/mamoe/mirai/console/data/PluginDataStorage;)Lnet/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleDataScope; -} - -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation$JConsoleCommandSenderImpl : net/mamoe/mirai/console/MiraiConsoleImplementation$ConsoleCommandSenderImpl { - public abstract fun sendMessage (Ljava/lang/String;)V - public synthetic fun sendMessage (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public abstract fun sendMessage (Lnet/mamoe/mirai/message/data/Message;)V - public synthetic fun sendMessage (Lnet/mamoe/mirai/message/data/Message;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -} - -public abstract interface class net/mamoe/mirai/console/MiraiConsoleImplementation$JConsoleInput : net/mamoe/mirai/console/util/ConsoleInput { - public abstract fun requestInput (Ljava/lang/String;)Ljava/lang/String; - public fun requestInput (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; -} - public final class net/mamoe/mirai/console/MiraiConsoleKt { public static final fun getRootDir (Lnet/mamoe/mirai/console/MiraiConsole;)Ljava/io/File; } diff --git a/mirai-console/backend/mirai-console/src/MiraiConsoleImplementation.kt b/mirai-console/backend/mirai-console/src/MiraiConsoleImplementation.kt index b010aaa5d..0d7ded158 100644 --- a/mirai-console/backend/mirai-console/src/MiraiConsoleImplementation.kt +++ b/mirai-console/backend/mirai-console/src/MiraiConsoleImplementation.kt @@ -56,6 +56,7 @@ import kotlin.coroutines.CoroutineContext @RequiresOptIn(level = RequiresOptIn.Level.ERROR) @Target(CLASS, TYPEALIAS, FUNCTION, PROPERTY, FIELD, CONSTRUCTOR) @MustBeDocumented +@ConsoleFrontEndImplementation public annotation class ConsoleFrontEndImplementation /** @@ -361,6 +362,7 @@ public interface MiraiConsoleImplementation : CoroutineScope { public val consoleLaunchOptions: ConsoleLaunchOptions get() = ConsoleLaunchOptions() + @ConsoleFrontEndImplementation public companion object { private val backendAccessInstance = object : BackendAccess { override val globalComponentStorage: ComponentStorage get() = GlobalComponentStorage