From 50e5550816906413f663227468d63d6c234af676 Mon Sep 17 00:00:00 2001 From: twisti Date: Thu, 5 Mar 2026 15:01:14 +0100 Subject: [PATCH] feat: add InternalAPIMarker annotation for internal API boundary designation --- gradle.properties | 2 +- .../api/surf-api-shared-public.api | 3 +++ .../api/annotation/InternalAPIMarker.kt | 22 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt diff --git a/gradle.properties b/gradle.properties index 9d4d2ffc..d821c6df 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled javaVersion=25 mcVersion=1.21.11 group=dev.slne.surf -version=1.21.11-2.59.4 +version=1.21.11-2.60.0 relocationPrefix=dev.slne.surf.surfapi.libs snapshot=false diff --git a/surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api b/surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api index 28b9dce0..1b2bbc57 100644 --- a/surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api +++ b/surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api @@ -4,6 +4,9 @@ public final class dev/slne/surf/surfapi/shared/api/annotation/AnnotationUtils { public final fun findAnnotation (Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/annotation/Annotation; } +public abstract interface annotation class dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker : java/lang/annotation/Annotation { +} + public abstract interface class dev/slne/surf/surfapi/shared/api/component/Component { public fun disable (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun enable (Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt b/surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt new file mode 100644 index 00000000..e0426a7b --- /dev/null +++ b/surf-api-shared/surf-api-shared-public/src/main/kotlin/dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker.kt @@ -0,0 +1,22 @@ +package dev.slne.surf.surfapi.shared.api.annotation + +/** + * Marker annotation that designates an annotation class as an Internal API marker. + * + * Annotation classes annotated with [InternalAPIMarker] are recognized by the IntelliJ plugin + * to identify internal API boundaries. Declarations annotated with such an annotation will be + * treated as invisible to consumers in other projects — similar to Kotlin's + * [DeprecationLevel.HIDDEN] behavior — rather than producing an opt-in warning or error. + * + * Example: + * ```kotlin + * @RequiresOptIn + * @InternalAPIMarker + * annotation class InternalSurfAPI + * + * @InternalSurfAPI + * fun internalFunction() { ... } + * ``` + */ +@Target(AnnotationTarget.ANNOTATION_CLASS) +annotation class InternalAPIMarker \ No newline at end of file