Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce InternalDokkaApi annotation #2904

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/api/core.api
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,9 @@ public final class org/jetbrains/dokka/GlobalDokkaConfiguration {
public fun toString ()Ljava/lang/String;
}

public abstract interface annotation class org/jetbrains/dokka/InternalDokkaApi : java/lang/annotation/Annotation {
}

public final class org/jetbrains/dokka/PackageOptionsImpl : org/jetbrains/dokka/DokkaConfiguration$PackageOptions {
public fun <init> (Ljava/lang/String;ZLjava/lang/Boolean;ZZLjava/util/Set;)V
public final fun component1 ()Ljava/lang/String;
Expand Down
7 changes: 7 additions & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.jetbrains.dokkaVersion
import org.jetbrains.kotlin.gradle.tasks.*
import org.jetbrains.registerDokkaArtifactPublication

plugins {
Expand Down Expand Up @@ -42,6 +43,12 @@ tasks {
}
}

tasks.withType(KotlinCompile::class).all {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=org.jetbrains.dokka.InternalDokkaApi",)
}
}

registerDokkaArtifactPublication("dokkaCore") {
artifactId = "dokka-core"
}
21 changes: 21 additions & 0 deletions core/src/main/kotlin/InternalDokkaApi.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.jetbrains.dokka


/**
* Marks declarations that are **internal** to Dokka core artifact.
* It means that this API is marked as **public** either for historical or technical reasons.
* It is not intended to be used outside of the Dokka project, has no behaviour guarantees,
* and may lack clear semantics, documentation and backward compatibility.
*
* If you are using such API, it is strongly suggested to migrate from it in order
* to keep backwards compatibility with future Dokka versions.
* Typically, the easiest way to do so is to copy-paste the corresponding utility into
* your own project.
*/
@RequiresOptIn(
level = RequiresOptIn.Level.ERROR,
message = "This is an internal Dokka API not intended for public use"
)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.FIELD)
@Retention(AnnotationRetention.BINARY)
public annotation class InternalDokkaApi()
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.jetbrains.dokka.utilities

import org.jetbrains.dokka.*

@InternalDokkaApi
interface SelfRepresentingSingletonSet<T : SelfRepresentingSingletonSet<T>> : Set<T> {
override val size: Int get() = 1

Expand Down