Skip to content

Commit 07afb0b

Browse files
authored
Add InternalAPIMarker annotation for internal API boundaries (#230)
2 parents d1ac469 + 610f206 commit 07afb0b

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
77
javaVersion=25
88
mcVersion=1.21.11
99
group=dev.slne.surf
10-
version=1.21.11-2.59.4
10+
version=1.21.11-2.60.0
1111
relocationPrefix=dev.slne.surf.surfapi.libs
1212
snapshot=false

surf-api-shared/surf-api-shared-public/api/surf-api-shared-public.api

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ public final class dev/slne/surf/surfapi/shared/api/annotation/AnnotationUtils {
44
public final fun findAnnotation (Ljava/lang/Class;Ljava/lang/Class;)Ljava/lang/annotation/Annotation;
55
}
66

7+
public abstract interface annotation class dev/slne/surf/surfapi/shared/api/annotation/InternalAPIMarker : java/lang/annotation/Annotation {
8+
}
9+
710
public abstract interface class dev/slne/surf/surfapi/shared/api/component/Component {
811
public fun disable (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
912
public fun enable (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package dev.slne.surf.surfapi.shared.api.annotation
2+
3+
/**
4+
* Marker annotation that designates an annotation class as an Internal API marker.
5+
*
6+
* Annotation classes annotated with [InternalAPIMarker] are recognized by the IntelliJ plugin
7+
* to identify internal API boundaries. Declarations annotated with such an annotation will be
8+
* treated as invisible to consumers in other projects — similar to Kotlin's
9+
* [DeprecationLevel.HIDDEN] behavior — rather than producing an opt-in warning or error.
10+
*
11+
* Example:
12+
* ```kotlin
13+
* @RequiresOptIn
14+
* @InternalAPIMarker
15+
* annotation class InternalSurfAPI
16+
*
17+
* @InternalSurfAPI
18+
* fun internalFunction() { ... }
19+
* ```
20+
*/
21+
@Target(AnnotationTarget.ANNOTATION_CLASS)
22+
annotation class InternalAPIMarker

0 commit comments

Comments
 (0)