diff options
21 files changed, 55 insertions, 40 deletions
diff --git a/core/src/main/kotlin/model/CompositeSourceSetID.kt b/core/src/main/kotlin/model/CompositeSourceSetID.kt new file mode 100644 index 00000000..5eb106bf --- /dev/null +++ b/core/src/main/kotlin/model/CompositeSourceSetID.kt @@ -0,0 +1,30 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.DokkaSourceSetID + +data class CompositeSourceSetID( + private val children: Set<DokkaSourceSetID> +) { + constructor(sourceSetIDs: Iterable<DokkaSourceSetID>) : this(sourceSetIDs.toSet()) + constructor(sourceSetId: DokkaSourceSetID) : this(setOf(sourceSetId)) + + init { + require(children.isNotEmpty()) { "Expected at least one source set id" } + } + + val merged = DokkaSourceSetID( + moduleName = children.map { it.moduleName }.reduce { acc, s -> "$acc+$s" }, + sourceSetName = children.map { it.sourceSetName }.reduce { acc, s -> "$acc+$s" } + ) + + val all: Set<DokkaSourceSetID> = setOf(merged, *children.toTypedArray()) + + operator fun contains(sourceSetId: DokkaSourceSetID): Boolean { + return sourceSetId in all + } + + operator fun contains(sourceSet: DokkaConfiguration.DokkaSourceSet): Boolean { + return sourceSet.sourceSetID in this + } +} diff --git a/core/src/main/kotlin/pages/ContentSourceSet.kt b/core/src/main/kotlin/model/ContentSourceSet.kt index f53cdb12..6eee4c94 100644 --- a/core/src/main/kotlin/pages/ContentSourceSet.kt +++ b/core/src/main/kotlin/model/ContentSourceSet.kt @@ -1,10 +1,9 @@ -package org.jetbrains.dokka.pages +package org.jetbrains.dokka.model import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform - data class ContentSourceSet( val sourceSetIDs: CompositeSourceSetID, val displayName: String, @@ -26,33 +25,6 @@ data class ContentSourceSet( } -data class CompositeSourceSetID( - private val children: Set<DokkaSourceSetID> -) { - constructor(sourceSetIDs: Iterable<DokkaSourceSetID>) : this(sourceSetIDs.toSet()) - constructor(sourceSetId: DokkaSourceSetID) : this(setOf(sourceSetId)) - - init { - require(children.isNotEmpty()) { "Expected at least one source set id" } - } - - val merged = DokkaSourceSetID( - moduleName = children.map { it.moduleName }.reduce { acc, s -> "$acc+$s" }, - sourceSetName = children.map { it.sourceSetName }.reduce { acc, s -> "$acc+$s" } - ) - - val all: List<DokkaSourceSetID> = listOf(merged, *children.toTypedArray()) - - operator fun contains(sourceSetId: DokkaSourceSetID): Boolean { - return sourceSetId in all - } - - operator fun contains(sourceSet: DokkaSourceSet): Boolean { - return sourceSet.sourceSetID in this - } -} - - fun DokkaSourceSet.toContentSourceSet(): ContentSourceSet = ContentSourceSet(this) fun Iterable<DokkaSourceSet>.toContentSourceSets(): Set<ContentSourceSet> = map { it.toContentSourceSet() }.toSet() diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 02d6bf61..0d43d062 100644 --- a/core/src/main/kotlin/pages/ContentNodes.kt +++ b/core/src/main/kotlin/pages/ContentNodes.kt @@ -1,6 +1,7 @@ package org.jetbrains.dokka.pages import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.WithChildren import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties diff --git a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt b/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt index 68af259d..ab9a2ab1 100644 --- a/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt +++ b/core/src/test/kotlin/model/CompositeSourceSetIDTest.kt @@ -1,7 +1,7 @@ package model import org.jetbrains.dokka.DokkaSourceSetID -import org.jetbrains.dokka.pages.CompositeSourceSetID +import org.jetbrains.dokka.model.CompositeSourceSetID import kotlin.test.* class CompositeSourceSetIDTest { diff --git a/core/src/test/kotlin/model/ContentSourceSetTest.kt b/core/src/test/kotlin/model/ContentSourceSetTest.kt index cb17bcba..b96180a2 100644 --- a/core/src/test/kotlin/model/ContentSourceSetTest.kt +++ b/core/src/test/kotlin/model/ContentSourceSetTest.kt @@ -2,9 +2,9 @@ package model import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.pages.CompositeSourceSetID -import org.jetbrains.dokka.pages.ContentSourceSet -import org.jetbrains.dokka.pages.sourceSetIDs +import org.jetbrains.dokka.model.CompositeSourceSetID +import org.jetbrains.dokka.model.ContentSourceSet +import org.jetbrains.dokka.model.sourceSetIDs import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 84be6df0..b7062310 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -6,6 +6,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.LocationProvider +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index ac2b1d02..d776e602 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -11,8 +11,10 @@ import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.base.renderers.TabSortingStrategy import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.dfs import org.jetbrains.dokka.model.properties.PropertyContainer +import org.jetbrains.dokka.model.sourceSetIDs import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt index 138a8e16..7c5d31f8 100644 --- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt +++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt @@ -3,7 +3,7 @@ package org.jetbrains.dokka.base.renderers.html import kotlinx.html.* import kotlinx.html.stream.createHTML import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.ContentSourceSet +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RendererSpecificPage import org.jetbrains.dokka.pages.RenderingStrategy diff --git a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt index a9a5e498..9c9a0c0e 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/BaseLocationProvider.kt @@ -3,8 +3,8 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.ContentSourceSet -import org.jetbrains.dokka.pages.sourceSetIDs +import org.jetbrains.dokka.model.ContentSourceSet +import org.jetbrains.dokka.model.sourceSetIDs import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.query diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 0021b7fb..c437b52a 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -4,6 +4,7 @@ import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.withDescendants import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt index bf5d9be4..d95594cf 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.ContentSourceSet +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt index c5e16cc3..3f903bb3 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt @@ -1,7 +1,7 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.pages.ContentSourceSet +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt index 3d9a9993..f5181f4a 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.base.transformers.pages.comments import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.properties.PropertyContainer +import org.jetbrains.dokka.model.toContentSourceSets import org.jetbrains.dokka.pages.* object DocTagToContentConverter : CommentsToContentConverter { diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt index aaf4b5c3..ca1a7e3b 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SourceSetMergingPageTransformer.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.base.transformers.pages.merger import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.model.ContentSourceSet +import org.jetbrains.dokka.model.toContentSourceSets import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer diff --git a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt index 1eecb114..c7202a0b 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt @@ -9,6 +9,7 @@ import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.analysis.EnvironmentAndFacade import org.jetbrains.dokka.base.renderers.sourceSets import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.doc.Sample import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt index 0488f4e0..f0cf8597 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -9,6 +9,7 @@ import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.analysis.DescriptorDocumentableSource import org.jetbrains.dokka.analysis.PsiDocumentableSource import org.jetbrains.dokka.model.WithExpectActual +import org.jetbrains.dokka.model.toContentSourceSets import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt index a556a96e..9d4f6a9e 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt @@ -9,6 +9,7 @@ import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.model.SourceSetDependent import org.jetbrains.dokka.model.doc.DocTag import org.jetbrains.dokka.model.properties.PropertyContainer +import org.jetbrains.dokka.model.toContentSourceSets import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.DokkaLogger diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index 20a8662d..d93b4e98 100644 --- a/plugins/gfm/src/main/kotlin/GfmPlugin.kt +++ b/plugins/gfm/src/main/kotlin/GfmPlugin.kt @@ -7,6 +7,7 @@ import org.jetbrains.dokka.base.renderers.PackageListCreator import org.jetbrains.dokka.base.renderers.RootCreator import org.jetbrains.dokka.base.resolvers.local.DefaultLocationProvider import org.jetbrains.dokka.base.resolvers.local.LocationProviderFactory +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt index c9513967..40e4fa30 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationProvider.kt @@ -7,7 +7,7 @@ import org.jetbrains.dokka.links.Nullable import org.jetbrains.dokka.links.parent import org.jetbrains.dokka.model.* import org.jetbrains.dokka.pages.ContentPage -import org.jetbrains.dokka.pages.ContentSourceSet +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.pages.PageNode import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt index afa59bd4..870d02f6 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/JavadocContentNodes.kt @@ -1,6 +1,7 @@ package org.jetbrains.dokka.javadoc.pages import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt index 259e4acb..3c6bd2ae 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/SearchScriptsCreator.kt @@ -3,9 +3,9 @@ package org.jetbrains.dokka.javadoc.renderer import org.jetbrains.dokka.javadoc.location.JavadocLocationProvider import org.jetbrains.dokka.javadoc.pages.* import org.jetbrains.dokka.javadoc.renderer.SearchRecord.Companion.allTypes -import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.renderers.sourceSets import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.ContentSourceSet import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.utilities.formatToEndWithHtml |