From 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Thu, 31 Aug 2023 20:16:01 +0200 Subject: Enable explicit API mode (#3139) --- .../dokka/analysis/kotlin/KotlinAnalysisPlugin.kt | 2 +- .../internal/DocumentableSourceLanguageParser.kt | 6 +++--- .../kotlin/internal/ExternalDocumentablesProvider.kt | 4 ++-- .../kotlin/internal/FullClassHierarchyBuilder.kt | 8 ++++---- .../analysis/kotlin/internal/InheritanceBuilder.kt | 6 +++--- .../kotlin/internal/InternalKotlinAnalysisPlugin.kt | 19 ++++++++++--------- .../analysis/kotlin/internal/KotlinToJavaService.kt | 4 ++-- .../internal/ModuleAndPackageDocumentationReader.kt | 8 ++++---- .../dokka/analysis/kotlin/internal/SampleProvider.kt | 14 ++++++++------ .../kotlin/internal/SyntheticDocumentableDetector.kt | 4 ++-- 10 files changed, 39 insertions(+), 36 deletions(-) (limited to 'subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka') diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/KotlinAnalysisPlugin.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/KotlinAnalysisPlugin.kt index 8d72d3e1..7d434bd5 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/KotlinAnalysisPlugin.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/KotlinAnalysisPlugin.kt @@ -8,7 +8,7 @@ import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.DokkaPluginApiPreview import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement -class KotlinAnalysisPlugin : DokkaPlugin() { +public class KotlinAnalysisPlugin : DokkaPlugin() { /* * This is where stable public API will go. diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/DocumentableSourceLanguageParser.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/DocumentableSourceLanguageParser.kt index ce66d09f..116adb06 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/DocumentableSourceLanguageParser.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/DocumentableSourceLanguageParser.kt @@ -10,11 +10,11 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.WithSources @InternalDokkaApi -enum class DocumentableLanguage { +public enum class DocumentableLanguage { JAVA, KOTLIN } @InternalDokkaApi -interface DocumentableSourceLanguageParser { - fun getLanguage(documentable: Documentable, sourceSet: DokkaConfiguration.DokkaSourceSet): DocumentableLanguage? +public interface DocumentableSourceLanguageParser { + public fun getLanguage(documentable: Documentable, sourceSet: DokkaConfiguration.DokkaSourceSet): DocumentableLanguage? } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ExternalDocumentablesProvider.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ExternalDocumentablesProvider.kt index 4d2f15ab..7c564880 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ExternalDocumentablesProvider.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ExternalDocumentablesProvider.kt @@ -17,12 +17,12 @@ import org.jetbrains.dokka.model.DClasslike * of classes defined in project). */ @InternalDokkaApi -fun interface ExternalDocumentablesProvider { +public fun interface ExternalDocumentablesProvider { /** * Returns [DClasslike] matching provided [DRI] in specified source set. * * Result is null if compiler haven't generated matching class descriptor. */ - fun findClasslike(dri: DRI, sourceSet: DokkaConfiguration.DokkaSourceSet): DClasslike? + public fun findClasslike(dri: DRI, sourceSet: DokkaConfiguration.DokkaSourceSet): DClasslike? } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/FullClassHierarchyBuilder.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/FullClassHierarchyBuilder.kt index 467a5f78..5b975fd8 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/FullClassHierarchyBuilder.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/FullClassHierarchyBuilder.kt @@ -10,12 +10,12 @@ import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.model.SourceSetDependent @InternalDokkaApi -typealias Supertypes = List +public typealias Supertypes = List @InternalDokkaApi -typealias ClassHierarchy = SourceSetDependent> +public typealias ClassHierarchy = SourceSetDependent> @InternalDokkaApi -interface FullClassHierarchyBuilder { - suspend fun build(module: DModule): ClassHierarchy +public interface FullClassHierarchyBuilder { + public suspend fun build(module: DModule): ClassHierarchy } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InheritanceBuilder.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InheritanceBuilder.kt index 175b162e..32077cde 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InheritanceBuilder.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InheritanceBuilder.kt @@ -9,12 +9,12 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.Documentable @InternalDokkaApi -interface InheritanceBuilder { - fun build(documentables: Map): List +public interface InheritanceBuilder { + public fun build(documentables: Map): List } @InternalDokkaApi -data class InheritanceNode( +public data class InheritanceNode( val dri: DRI, val children: List = emptyList(), val interfaces: List = emptyList(), diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InternalKotlinAnalysisPlugin.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InternalKotlinAnalysisPlugin.kt index 8fb08ae4..0ef1399a 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InternalKotlinAnalysisPlugin.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/InternalKotlinAnalysisPlugin.kt @@ -7,6 +7,7 @@ package org.jetbrains.dokka.analysis.kotlin.internal import org.jetbrains.dokka.InternalDokkaApi import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.DokkaPluginApiPreview +import org.jetbrains.dokka.plugability.ExtensionPoint import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement /** @@ -14,23 +15,23 @@ import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement * external plugins. If you need any of the given API stabilized, please create an issue describing your use case. */ @InternalDokkaApi -class InternalKotlinAnalysisPlugin : DokkaPlugin() { +public class InternalKotlinAnalysisPlugin : DokkaPlugin() { - val fullClassHierarchyBuilder by extensionPoint() + public val fullClassHierarchyBuilder: ExtensionPoint by extensionPoint() - val syntheticDocumentableDetector by extensionPoint() + public val syntheticDocumentableDetector: ExtensionPoint by extensionPoint() - val moduleAndPackageDocumentationReader by extensionPoint() + public val moduleAndPackageDocumentationReader: ExtensionPoint by extensionPoint() - val kotlinToJavaService by extensionPoint() + public val kotlinToJavaService: ExtensionPoint by extensionPoint() - val inheritanceBuilder by extensionPoint() + public val inheritanceBuilder: ExtensionPoint by extensionPoint() - val externalDocumentablesProvider by extensionPoint() + public val externalDocumentablesProvider: ExtensionPoint by extensionPoint() - val documentableSourceLanguageParser by extensionPoint() + public val documentableSourceLanguageParser: ExtensionPoint by extensionPoint() - val sampleProviderFactory by extensionPoint() + public val sampleProviderFactory: ExtensionPoint by extensionPoint() @OptIn(DokkaPluginApiPreview::class) override fun pluginApiPreviewAcknowledgement(): PluginApiPreviewAcknowledgement = PluginApiPreviewAcknowledgement diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/KotlinToJavaService.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/KotlinToJavaService.kt index 1b42a1b8..c8e99d10 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/KotlinToJavaService.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/KotlinToJavaService.kt @@ -8,6 +8,6 @@ import org.jetbrains.dokka.InternalDokkaApi import org.jetbrains.dokka.links.DRI @InternalDokkaApi -interface KotlinToJavaService { - fun findAsJava(kotlinDri: DRI): DRI? +public interface KotlinToJavaService { + public fun findAsJava(kotlinDri: DRI): DRI? } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ModuleAndPackageDocumentationReader.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ModuleAndPackageDocumentationReader.kt index eb08e888..70419e0e 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ModuleAndPackageDocumentationReader.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/ModuleAndPackageDocumentationReader.kt @@ -12,8 +12,8 @@ import org.jetbrains.dokka.model.SourceSetDependent import org.jetbrains.dokka.model.doc.DocumentationNode @InternalDokkaApi -interface ModuleAndPackageDocumentationReader { - fun read(module: DModule): SourceSetDependent - fun read(pkg: DPackage): SourceSetDependent - fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode? +public interface ModuleAndPackageDocumentationReader { + public fun read(module: DModule): SourceSetDependent + public fun read(pkg: DPackage): SourceSetDependent + public fun read(module: DokkaConfiguration.DokkaModuleDescription): DocumentationNode? } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider.kt index 2e1564e6..472d17f0 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider.kt @@ -8,13 +8,13 @@ import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.InternalDokkaApi @InternalDokkaApi -interface SampleProviderFactory { +public interface SampleProviderFactory { /** * [SampleProvider] is a short-lived closeable instance. * It assumes that [SampleProvider] scope of use is not big. * Otherwise, it can lead to high memory consumption / leaks during Dokka running. */ - fun build(): SampleProvider + public fun build(): SampleProvider } /** @@ -23,12 +23,14 @@ interface SampleProviderFactory { * In general case, it creates a separate project to analysis samples directories. */ @InternalDokkaApi -interface SampleProvider: AutoCloseable { - class SampleSnippet(val imports: String, val body:String) - +public interface SampleProvider: AutoCloseable { + public class SampleSnippet( + public val imports: String, + public val body: String + ) /** * @return [SampleSnippet] or null if it has not found by [fqLink] */ - fun getSample(sourceSet: DokkaConfiguration.DokkaSourceSet, fqLink: String): SampleSnippet? + public fun getSample(sourceSet: DokkaConfiguration.DokkaSourceSet, fqLink: String): SampleSnippet? } diff --git a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SyntheticDocumentableDetector.kt b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SyntheticDocumentableDetector.kt index e7d83471..0a2d64de 100644 --- a/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SyntheticDocumentableDetector.kt +++ b/subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SyntheticDocumentableDetector.kt @@ -10,6 +10,6 @@ import org.jetbrains.dokka.model.Documentable // TODO [beresnev] isSynthetic could be a property of Documentable @InternalDokkaApi -interface SyntheticDocumentableDetector { - fun isSynthetic(documentable: Documentable, sourceSet: DokkaConfiguration.DokkaSourceSet): Boolean +public interface SyntheticDocumentableDetector { + public fun isSynthetic(documentable: Documentable, sourceSet: DokkaConfiguration.DokkaSourceSet): Boolean } -- cgit