diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2020-05-05 17:45:12 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-05-14 13:30:33 +0200 |
commit | 3f2a790190da4f40ea6d8a976aa1929b2a1b002b (patch) | |
tree | 752ee84451954e9ea5e6d4133e18e41aaee2f7b1 | |
parent | a440f0cb8756019131a2c15389e747aea3c585e7 (diff) | |
download | dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.gz dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.bz2 dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.zip |
Changing approach from platform-driven to source-set-driven
153 files changed, 1453 insertions, 1446 deletions
diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7ee14d19..a7e03ba2 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -16,8 +16,14 @@ <module name="android-gradle-plugin_test" target="1.8" /> <module name="ant_main" target="1.8" /> <module name="ant_test" target="1.8" /> + <module name="base.dokka.plugins.base.main" target="1.8" /> + <module name="base.dokka.plugins.base.test" target="1.8" /> + <module name="blazejkardys.Workspace.dokka.buildSrc.main" target="1.8" /> + <module name="blazejkardys.Workspace.dokka.buildSrc.test" target="1.8" /> <module name="buildSrc_main" target="1.8" /> <module name="buildSrc_test" target="1.8" /> + <module name="cli.dokka.runners.cli.main" target="1.8" /> + <module name="cli.dokka.runners.cli.test" target="1.8" /> <module name="cli_main" target="1.8" /> <module name="cli_test" target="1.8" /> <module name="core_main" target="1.8" /> @@ -78,14 +84,24 @@ <module name="dokka.testApi.test" target="1.8" /> <module name="fatjar_main" target="1.8" /> <module name="fatjar_test" target="1.8" /> + <module name="gradle-integration-tests.dokka.integration-tests.gradle-integration-tests.main" target="1.8" /> + <module name="gradle-integration-tests.dokka.integration-tests.gradle-integration-tests.test" target="1.8" /> <module name="gradle-integration-tests.org.jetbrains.dokka.gradle-integration-tests.main" target="1.8" /> <module name="gradle-integration-tests.org.jetbrains.dokka.gradle-integration-tests.test" target="1.8" /> <module name="gradle-integration-tests_main" target="1.8" /> <module name="gradle-integration-tests_test" target="1.8" /> + <module name="gradle-plugin.dokka.runners.gradle-plugin.main" target="1.8" /> + <module name="gradle-plugin.dokka.runners.gradle-plugin.test" target="1.8" /> <module name="gradle-plugin_main" target="1.8" /> <module name="gradle-plugin_test" target="1.8" /> <module name="integration_main" target="1.8" /> <module name="integration_test" target="1.8" /> + <module name="kotlin-as-java.dokka.plugins.kotlin-as-java.main" target="1.8" /> + <module name="kotlin-as-java.dokka.plugins.kotlin-as-java.test" target="1.8" /> + <module name="mathjax.dokka.plugins.mathjax.main" target="1.8" /> + <module name="mathjax.dokka.plugins.mathjax.test" target="1.8" /> + <module name="maven-plugin.dokka.runners.maven-plugin.main" target="1.8" /> + <module name="maven-plugin.dokka.runners.maven-plugin.test" target="1.8" /> <module name="maven-plugin_main" target="1.8" /> <module name="maven-plugin_test" target="1.8" /> <module name="org.jetbrains.dokka.android-gradle-plugin.main" target="1.8" /> @@ -101,6 +117,8 @@ <module name="org.jetbrains.dokka.coreDependencies.main" target="1.8" /> <module name="org.jetbrains.dokka.coreDependencies.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.core.main" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.core.search-component.main" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.core.search-component.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.core.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.coreDependencies.main" target="1.8" /> <module name="org.jetbrains.dokka.dokka.coreDependencies.test" target="1.8" /> @@ -110,6 +128,10 @@ <module name="org.jetbrains.dokka.dokka.integration-tests.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.plugins.base.main" target="1.8" /> <module name="org.jetbrains.dokka.dokka.plugins.base.test" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.plugins.gfm.main" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.plugins.gfm.test" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.plugins.jekyll.main" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.plugins.jekyll.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.plugins.kotlin-as-java.main" target="1.8" /> <module name="org.jetbrains.dokka.dokka.plugins.kotlin-as-java.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.plugins.main" target="1.8" /> @@ -126,6 +148,8 @@ <module name="org.jetbrains.dokka.dokka.runners.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.search-component.main" target="1.8" /> <module name="org.jetbrains.dokka.dokka.search-component.test" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.test-tools.main" target="1.8" /> + <module name="org.jetbrains.dokka.dokka.test-tools.test" target="1.8" /> <module name="org.jetbrains.dokka.dokka.testApi.main" target="1.8" /> <module name="org.jetbrains.dokka.dokka.testApi.test" target="1.8" /> <module name="org.jetbrains.dokka.fatjar.main" target="1.8" /> @@ -150,6 +174,18 @@ <module name="org.jetbrains.dokka.xml.test" target="1.8" /> <module name="Workspace.dokka.buildSrc.main" target="1.8" /> <module name="Workspace.dokka.buildSrc.test" target="1.8" /> + <module name="Workspace.dokka.core.main" target="1.8" /> + <module name="Workspace.dokka.core.test" target="1.8" /> + <module name="Workspace.dokka.coreDependencies.main" target="1.8" /> + <module name="Workspace.dokka.coreDependencies.test" target="1.8" /> + <module name="Workspace.dokka.integration-tests.main" target="1.8" /> + <module name="Workspace.dokka.integration-tests.test" target="1.8" /> + <module name="Workspace.dokka.plugins.main" target="1.8" /> + <module name="Workspace.dokka.plugins.test" target="1.8" /> + <module name="Workspace.dokka.runners.main" target="1.8" /> + <module name="Workspace.dokka.runners.test" target="1.8" /> + <module name="Workspace.dokka.testApi.main" target="1.8" /> + <module name="Workspace.dokka.testApi.test" target="1.8" /> </bytecodeTargetLevel> </component> </project>
\ No newline at end of file diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt index 053b4cb6..6e62c033 100644 --- a/core/src/main/kotlin/DokkaGenerator.kt +++ b/core/src/main/kotlin/DokkaGenerator.kt @@ -1,23 +1,20 @@ package org.jetbrains.dokka -import com.intellij.openapi.vfs.VirtualFileManager -import com.intellij.psi.PsiJavaFile -import com.intellij.psi.PsiManager import org.jetbrains.dokka.analysis.AnalysisEnvironment import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.model.DModule -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.common.messages.MessageRenderer import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot import org.jetbrains.kotlin.utils.PathUtil import java.io.File @@ -31,13 +28,14 @@ class DokkaGenerator( ) { fun generate() = timed { report("Setting up analysis environments") - val platforms: Map<PlatformData, EnvironmentAndFacade> = setUpAnalysis(configuration) + val sourceSetsCache = SourceSetCache() + val sourceSets: Map<SourceSetData, EnvironmentAndFacade> = setUpAnalysis(configuration, sourceSetsCache) report("Initializing plugins") - val context = initializePlugins(configuration, logger, platforms) + val context = initializePlugins(configuration, logger, sourceSets, sourceSetsCache) report("Creating documentation models") - val modulesFromPlatforms = createDocumentationModels(platforms, context) + val modulesFromPlatforms = createDocumentationModels(sourceSets, context) report("Transforming documentation model before merging") val transformedDocumentationBeforeMerge = transformDocumentationModelBeforeMerge(modulesFromPlatforms, context) @@ -62,27 +60,31 @@ class DokkaGenerator( logger.report() }.dump("\n\n === TIME MEASUREMENT ===\n") - fun setUpAnalysis(configuration: DokkaConfiguration): Map<PlatformData, EnvironmentAndFacade> = + fun setUpAnalysis( + configuration: DokkaConfiguration, + sourceSetsCache: SourceSetCache + ): Map<SourceSetData, EnvironmentAndFacade> = configuration.passesConfigurations.map { - it.platformData to createEnvironmentAndFacade(it) + sourceSetsCache.getSourceSet(it) to createEnvironmentAndFacade(it) }.toMap() fun initializePlugins( configuration: DokkaConfiguration, logger: DokkaLogger, - platforms: Map<PlatformData, EnvironmentAndFacade>, + sourceSets: Map<SourceSetData, EnvironmentAndFacade>, + sourceSetsCache: SourceSetCache, pluginOverrides: List<DokkaPlugin> = emptyList() - ) = DokkaContext.create(configuration, logger, platforms, pluginOverrides) + ) = DokkaContext.create(configuration, logger, sourceSets, sourceSetsCache, pluginOverrides) fun createDocumentationModels( - platforms: Map<PlatformData, EnvironmentAndFacade>, + platforms: Map<SourceSetData, EnvironmentAndFacade>, context: DokkaContext ) = platforms.flatMap { (pdata, _) -> translateSources(pdata, context) } fun transformDocumentationModelBeforeMerge( modulesFromPlatforms: List<DModule>, context: DokkaContext - ) = context[CoreExtensions.preMergeDocumentableTransformer].fold(modulesFromPlatforms) { acc, t -> t(acc, context) } + ) = context[CoreExtensions.preMergeDocumentableTransformer].fold(modulesFromPlatforms) { acc, t -> t(acc) } fun mergeDocumentationModels( modulesFromPlatforms: List<DModule>, @@ -119,7 +121,7 @@ class DokkaGenerator( } pass.classpath.forEach { addClasspath(File(it)) } - addSources(pass.sourceRoots.map { it.path }) + addSources((pass.sourceRoots + pass.dependentSourceRoots).map { it.path }) loadLanguageVersionSettings(pass.languageVersion, pass.apiVersion) @@ -128,7 +130,7 @@ class DokkaGenerator( EnvironmentAndFacade(environment, facade) } - private fun translateSources(platformData: PlatformData, context: DokkaContext) = + private fun translateSources(platformData: SourceSetData, context: DokkaContext) = context[CoreExtensions.sourceToDocumentableTranslator].map { it.invoke(platformData, context) } diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 34671c4e..88924924 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka -import org.jetbrains.dokka.pages.PlatformData import java.io.File import java.net.URL @@ -37,8 +36,10 @@ interface DokkaConfiguration { interface PassConfiguration { val moduleName: String + val sourceSetName: String val classpath: List<String> val sourceRoots: List<SourceRoot> + val dependentSourceRoots: List<SourceRoot> val samples: List<String> val includes: List<String> val includeNonPublic: Boolean @@ -59,9 +60,6 @@ interface DokkaConfiguration { val analysisPlatform: Platform val targets: List<String> val sinceKotlin: String? - - val platformData: PlatformData - get() = PlatformData(moduleName, analysisPlatform, targets) } interface SourceRoot { diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index ae674ea1..08f70b45 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -16,8 +16,10 @@ data class DokkaConfigurationImpl( data class PassConfigurationImpl ( override val moduleName: String, + override val sourceSetName: String, override val classpath: List<String>, override val sourceRoots: List<SourceRootImpl>, + override val dependentSourceRoots: List<SourceRootImpl>, override val samples: List<String>, override val includes: List<String>, override val includeNonPublic: Boolean, diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt index 313f4cd4..85487725 100644 --- a/core/src/main/kotlin/model/Documentable.kt +++ b/core/src/main/kotlin/model/Documentable.kt @@ -1,11 +1,12 @@ package org.jetbrains.dokka.model import com.intellij.psi.PsiNamedElement +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.Platform import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.load.kotlin.toSourceElement @@ -13,8 +14,9 @@ abstract class Documentable { abstract val name: String? abstract val dri: DRI abstract val children: List<Documentable> - abstract val documentation: PlatformDependent<DocumentationNode> - abstract val platformData: List<PlatformData> + abstract val documentation: SourceSetDependent<DocumentationNode> + abstract val sourceSets: List<SourceSetData> + abstract val expectPresentInSet: SourceSetData? override fun toString(): String = "${javaClass.simpleName}($dri)" @@ -25,45 +27,10 @@ abstract class Documentable { override fun hashCode() = dri.hashCode() } -data class PlatformDependent<out T>( - val map: Map<PlatformData, T>, - val expect: T? = null -) : Map<PlatformData, T> by map { - val prevalentValue: T? - get() = map.values.distinct().singleOrNull() - - val allValues: Sequence<T> = sequence { - expect?.also { yield(it) } - yieldAll(map.values) - } - - val allEntries: Sequence<Pair<PlatformData?, T>> = sequence { - expect?.also { yield(null to it) } - map.forEach { (k, v) -> yield(k to v) } - } - - fun getOrExpect(platform: PlatformData): T? = map[platform] ?: expect - - companion object { - fun <T> empty(): PlatformDependent<T> = PlatformDependent(emptyMap()) - - fun <T> from(platformData: PlatformData, element: T) = PlatformDependent(mapOf(platformData to element)) - - @Suppress("UNCHECKED_CAST") - fun <T> from(pairs: Iterable<Pair<PlatformData?, T>>) = - PlatformDependent( - pairs.filter { it.first != null }.toMap() as Map<PlatformData, T>, - pairs.firstOrNull { it.first == null }?.second - ) - - fun <T> from(vararg pairs: Pair<PlatformData?, T>) = from(pairs.asIterable()) - - fun <T> expectFrom(element: T) = PlatformDependent(map = emptyMap(), expect = element) - } -} +typealias SourceSetDependent<T> = Map<SourceSetData, T> interface WithExpectActual { - val sources: PlatformDependent<DocumentableSource> + val sources: SourceSetDependent<DocumentableSource> } interface WithScope { @@ -73,7 +40,7 @@ interface WithScope { } interface WithVisibility { - val visibility: PlatformDependent<Visibility> + val visibility: SourceSetDependent<Visibility> } interface WithType { @@ -81,7 +48,7 @@ interface WithType { } interface WithAbstraction { - val modifier: PlatformDependent<Modifier> + val modifier: SourceSetDependent<Modifier> } sealed class Modifier(val name: String) @@ -112,7 +79,7 @@ interface WithGenerics { } interface WithSupertypes { - val supertypes: PlatformDependent<List<DRI>> + val supertypes: SourceSetDependent<List<DRI>> } interface Callable : WithVisibility, WithType, WithAbstraction, WithExpectActual { @@ -124,8 +91,9 @@ sealed class DClasslike : Documentable(), WithScope, WithVisibility, WithExpectA data class DModule( override val name: String, val packages: List<DPackage>, - override val documentation: PlatformDependent<DocumentationNode>, - override val platformData: List<PlatformData>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData? = null, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DModule> = PropertyContainer.empty() ) : Documentable(), WithExtraProperties<DModule> { override val dri: DRI = DRI.topLevel @@ -141,8 +109,9 @@ data class DPackage( override val properties: List<DProperty>, override val classlikes: List<DClasslike>, val typealiases: List<DTypeAlias>, - override val documentation: PlatformDependent<DocumentationNode>, - override val platformData: List<PlatformData>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData? = null, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DPackage> = PropertyContainer.empty() ) : Documentable(), WithScope, WithExtraProperties<DPackage> { override val name = dri.packageName.orEmpty() @@ -159,14 +128,15 @@ data class DClass( override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val sources: PlatformDependent<DocumentableSource>, - override val visibility: PlatformDependent<Visibility>, + override val sources: SourceSetDependent<DocumentableSource>, + override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val generics: List<DTypeParameter>, - override val supertypes: PlatformDependent<List<DRI>>, - override val documentation: PlatformDependent<DocumentationNode>, - override val modifier: PlatformDependent<Modifier>, - override val platformData: List<PlatformData>, + override val supertypes: SourceSetDependent<List<DRI>>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val modifier: SourceSetDependent<Modifier>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DClass> = PropertyContainer.empty() ) : DClasslike(), WithAbstraction, WithCompanion, WithConstructors, WithGenerics, WithSupertypes, WithExtraProperties<DClass> { @@ -181,16 +151,17 @@ data class DEnum( override val dri: DRI, override val name: String, val entries: List<DEnumEntry>, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val visibility: PlatformDependent<Visibility>, + override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val constructors: List<DFunction>, - override val supertypes: PlatformDependent<List<DRI>>, - override val platformData: List<PlatformData>, + override val supertypes: SourceSetDependent<List<DRI>>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DEnum> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithSupertypes, WithExtraProperties<DEnum> { override val children: List<Documentable> @@ -202,11 +173,12 @@ data class DEnum( data class DEnumEntry( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent<DocumentationNode>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val platformData: List<PlatformData>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DEnumEntry> = PropertyContainer.empty() ) : Documentable(), WithScope, WithExtraProperties<DEnumEntry> { override val children: List<Documentable> @@ -220,14 +192,15 @@ data class DFunction( override val name: String, val isConstructor: Boolean, val parameters: List<DParameter>, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, - override val visibility: PlatformDependent<Visibility>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, + override val visibility: SourceSetDependent<Visibility>, override val type: Bound, override val generics: List<DTypeParameter>, override val receiver: DParameter?, - override val modifier: PlatformDependent<Modifier>, - override val platformData: List<PlatformData>, + override val modifier: SourceSetDependent<Modifier>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DFunction> = PropertyContainer.empty() ) : Documentable(), Callable, WithGenerics, WithExtraProperties<DFunction> { override val children: List<Documentable> @@ -239,16 +212,17 @@ data class DFunction( data class DInterface( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val visibility: PlatformDependent<Visibility>, + override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val generics: List<DTypeParameter>, - override val supertypes: PlatformDependent<List<DRI>>, - override val platformData: List<PlatformData>, + override val supertypes: SourceSetDependent<List<DRI>>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DInterface> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithGenerics, WithSupertypes, WithExtraProperties<DInterface> { override val children: List<Documentable> @@ -260,14 +234,15 @@ data class DInterface( data class DObject( override val name: String?, override val dri: DRI, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val visibility: PlatformDependent<Visibility>, - override val supertypes: PlatformDependent<List<DRI>>, - override val platformData: List<PlatformData>, + override val visibility: SourceSetDependent<Visibility>, + override val supertypes: SourceSetDependent<List<DRI>>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DObject> = PropertyContainer.empty() ) : DClasslike(), WithSupertypes, WithExtraProperties<DObject> { override val children: List<Documentable> @@ -279,15 +254,16 @@ data class DObject( data class DAnnotation( override val name: String, override val dri: DRI, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, override val functions: List<DFunction>, override val properties: List<DProperty>, override val classlikes: List<DClasslike>, - override val visibility: PlatformDependent<Visibility>, + override val visibility: SourceSetDependent<Visibility>, override val companion: DObject?, override val constructors: List<DFunction>, - override val platformData: List<PlatformData>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DAnnotation> = PropertyContainer.empty() ) : DClasslike(), WithCompanion, WithConstructors, WithExtraProperties<DAnnotation> { override val children: List<Documentable> @@ -299,15 +275,16 @@ data class DAnnotation( data class DProperty( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent<DocumentationNode>, - override val sources: PlatformDependent<DocumentableSource>, - override val visibility: PlatformDependent<Visibility>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sources: SourceSetDependent<DocumentableSource>, + override val visibility: SourceSetDependent<Visibility>, override val type: Bound, override val receiver: DParameter?, val setter: DFunction?, val getter: DFunction?, - override val modifier: PlatformDependent<Modifier>, - override val platformData: List<PlatformData>, + override val modifier: SourceSetDependent<Modifier>, + override val sourceSets: List<SourceSetData>, override val generics: List<DTypeParameter>, override val extra: PropertyContainer<DProperty> = PropertyContainer.empty() ) : Documentable(), Callable, WithExtraProperties<DProperty>, WithGenerics { @@ -321,9 +298,10 @@ data class DProperty( data class DParameter( override val dri: DRI, override val name: String?, - override val documentation: PlatformDependent<DocumentationNode>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, val type: Bound, - override val platformData: List<PlatformData>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DParameter> = PropertyContainer.empty() ) : Documentable(), WithExtraProperties<DParameter> { override val children: List<Nothing> @@ -335,9 +313,10 @@ data class DParameter( data class DTypeParameter( override val dri: DRI, override val name: String, - override val documentation: PlatformDependent<DocumentationNode>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, val bounds: List<Bound>, - override val platformData: List<PlatformData>, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DTypeParameter> = PropertyContainer.empty() ) : Documentable(), WithExtraProperties<DTypeParameter> { override val children: List<Nothing> @@ -350,10 +329,11 @@ data class DTypeAlias( override val dri: DRI, override val name: String, override val type: Bound, - val underlyingType: PlatformDependent<Bound>, - override val visibility: PlatformDependent<Visibility>, - override val documentation: PlatformDependent<DocumentationNode>, - override val platformData: List<PlatformData>, + val underlyingType: SourceSetDependent<Bound>, + override val visibility: SourceSetDependent<Visibility>, + override val documentation: SourceSetDependent<DocumentationNode>, + override val expectPresentInSet: SourceSetData?, + override val sourceSets: List<SourceSetData>, override val extra: PropertyContainer<DTypeAlias> = PropertyContainer.empty() ) : Documentable(), WithType, WithVisibility, WithExtraProperties<DTypeAlias> { override val children: List<Nothing> @@ -417,7 +397,7 @@ sealed class JavaVisibility(name: String) : Visibility(name) { object Default : JavaVisibility("") } -fun <T> PlatformDependent<T>?.orEmpty(): PlatformDependent<T> = this ?: PlatformDependent.empty() +fun <T> SourceSetDependent<T>?.orEmpty(): SourceSetDependent<T> = this ?: emptyMap() interface DocumentableSource { val path: String @@ -429,4 +409,4 @@ class DescriptorDocumentableSource(val descriptor: DeclarationDescriptor) : Docu class PsiDocumentableSource(val psi: PsiNamedElement) : DocumentableSource { override val path = psi.containingFile.virtualFile.path -} +}
\ No newline at end of file diff --git a/core/src/main/kotlin/model/SourceSetData.kt b/core/src/main/kotlin/model/SourceSetData.kt new file mode 100644 index 00000000..8f67f272 --- /dev/null +++ b/core/src/main/kotlin/model/SourceSetData.kt @@ -0,0 +1,23 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.plugability.DokkaContext + +data class SourceSetData( + val moduleName: String, + val sourceSetName: String, + val platform: Platform, + val sourceRoots: List<DokkaConfiguration.SourceRoot> = emptyList() +) + +class SourceSetCache { + private val sourceSets = HashMap<String, SourceSetData>() + + fun getSourceSet(pass: DokkaConfiguration.PassConfiguration) = + sourceSets.getOrPut("${pass.moduleName}/${pass.sourceSetName}", + { SourceSetData(pass.moduleName, pass.sourceSetName, pass.analysisPlatform, pass.sourceRoots) } + ) +} + +fun DokkaContext.sourceSet(pass: DokkaConfiguration.PassConfiguration) : SourceSetData = sourceSetCache.getSourceSet(pass)
\ No newline at end of file diff --git a/core/src/main/kotlin/model/aditionalExtras.kt b/core/src/main/kotlin/model/aditionalExtras.kt index 58209939..27ad8a55 100644 --- a/core/src/main/kotlin/model/aditionalExtras.kt +++ b/core/src/main/kotlin/model/aditionalExtras.kt @@ -41,13 +41,13 @@ object PrimaryConstructorExtra : ExtraProperty<DFunction>, ExtraProperty.Key<DFu override val key: ExtraProperty.Key<DFunction, *> = this } -data class ActualTypealias(val underlyingType: PlatformDependent<Bound>) : ExtraProperty<DClasslike> { +data class ActualTypealias(val underlyingType: SourceSetDependent<Bound>) : ExtraProperty<DClasslike> { companion object : ExtraProperty.Key<DClasslike, ActualTypealias> { override fun mergeStrategyFor( left: ActualTypealias, right: ActualTypealias ) = - MergeStrategy.Replace(ActualTypealias(PlatformDependent(left.underlyingType + right.underlyingType))) + MergeStrategy.Replace(ActualTypealias(left.underlyingType + right.underlyingType)) } override val key: ExtraProperty.Key<DClasslike, ActualTypealias> = ActualTypealias diff --git a/core/src/main/kotlin/model/documentableUtils.kt b/core/src/main/kotlin/model/documentableUtils.kt index 7f946344..b09260ee 100644 --- a/core/src/main/kotlin/model/documentableUtils.kt +++ b/core/src/main/kotlin/model/documentableUtils.kt @@ -1,21 +1,18 @@ package org.jetbrains.dokka.model -import org.jetbrains.dokka.pages.PlatformData +fun <T> SourceSetDependent<T>.filtered(platformDataList: List<SourceSetData>) = filter { it.key in platformDataList } +fun SourceSetData?.filtered(platformDataList: List<SourceSetData>) = takeIf { this in platformDataList } -fun <T> PlatformDependent<T>.filtered(platformDataList: List<PlatformData>) = PlatformDependent( - map.filter { it.key in platformDataList }, - expect -) - -fun DTypeParameter.filter(filteredData: List<PlatformData>) = - if (filteredData.containsAll(platformData)) this +fun DTypeParameter.filter(filteredData: List<SourceSetData>) = + if (filteredData.containsAll(sourceSets)) this else { - val intersection = filteredData.intersect(platformData).toList() + val intersection = filteredData.intersect(sourceSets).toList() if (intersection.isEmpty()) null else DTypeParameter( dri, name, documentation.filtered(intersection), + expectPresentInSet?.takeIf { intersection.contains(expectPresentInSet) }, bounds, intersection, extra diff --git a/core/src/main/kotlin/pages/ContentNodes.kt b/core/src/main/kotlin/pages/ContentNodes.kt index 26bcdf77..bb669199 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.SourceSetData import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties @@ -10,7 +11,7 @@ data class DCI(val dri: Set<DRI>, val kind: Kind) { interface ContentNode : WithExtraProperties<ContentNode> { val dci: DCI - val platforms: Set<PlatformData> + val sourceSets: Set<SourceSetData> val style: Set<Style> } @@ -18,7 +19,7 @@ interface ContentNode : WithExtraProperties<ContentNode> { data class ContentText( val text: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentNode { @@ -27,7 +28,7 @@ data class ContentText( // TODO: Remove data class ContentBreakLine( - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val dci: DCI = DCI(emptySet(), ContentKind.Empty), override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() @@ -40,11 +41,11 @@ data class ContentHeader( override val children: List<ContentNode>, val level: Int, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { - constructor(level: Int, c: ContentComposite) : this(c.children, level, c.dci, c.platforms, c.style, c.extra) + constructor(level: Int, c: ContentComposite) : this(c.children, level, c.dci, c.sourceSets, c.style, c.extra) override fun withNewExtras(newExtras: PropertyContainer<ContentNode>): ContentHeader = copy(extra = newExtras) } @@ -54,7 +55,7 @@ data class ContentCode( override val children: List<ContentNode>, val language: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -69,7 +70,7 @@ data class ContentDRILink( override val children: List<ContentNode>, val address: DRI, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -81,7 +82,7 @@ data class ContentResolvedLink( override val children: List<ContentNode>, val address: String, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -95,7 +96,7 @@ data class ContentEmbeddedResource( val address: String, val altText: String?, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style> = emptySet(), override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentLink { @@ -113,7 +114,7 @@ data class ContentTable( val header: List<ContentGroup>, override val children: List<ContentGroup>, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -125,7 +126,7 @@ data class ContentList( override val children: List<ContentNode>, val ordered: Boolean, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -136,7 +137,7 @@ data class ContentList( data class ContentGroup( override val children: List<ContentNode>, override val dci: DCI, - override val platforms: Set<PlatformData>, + override val sourceSets: Set<SourceSetData>, override val style: Set<Style>, override val extra: PropertyContainer<ContentNode> = PropertyContainer.empty() ) : ContentComposite { @@ -145,7 +146,7 @@ data class ContentGroup( data class PlatformHintedContent( val inner: ContentNode, - override val platforms: Set<PlatformData> + override val sourceSets: Set<SourceSetData> ) : ContentComposite { override val children = listOf(inner) @@ -171,7 +172,7 @@ interface Kind enum class ContentKind : Kind { Comment, Constructors, Functions, Parameters, Properties, Classlikes, Packages, Symbol, Sample, Main, BriefComment, - Empty, Source, TypeAliases, Cover, Inheritors, PlatformDependantHint; + Empty, Source, TypeAliases, Cover, Inheritors, SourceSetDependantHint; companion object { private val platformTagged = diff --git a/core/src/main/kotlin/pages/PageNodes.kt b/core/src/main/kotlin/pages/PageNodes.kt index 244d951e..32b2846e 100644 --- a/core/src/main/kotlin/pages/PageNodes.kt +++ b/core/src/main/kotlin/pages/PageNodes.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.pages +import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.model.Documentable import org.jetbrains.dokka.Platform import org.jetbrains.dokka.links.DRI @@ -151,10 +152,6 @@ class MemberPageNode( else MemberPageNode(name, content, dri, documentable, children, embeddedResources) } -data class PlatformData(val name: String, val platformType: Platform, val targets: List<String>) { - override fun toString() = targets.toString() -} - fun PageNode.dfs(predicate: (PageNode) -> Boolean): PageNode? = if (predicate(this)) { this } else { diff --git a/core/src/main/kotlin/plugability/DokkaContext.kt b/core/src/main/kotlin/plugability/DokkaContext.kt index cefcd286..692803dd 100644 --- a/core/src/main/kotlin/plugability/DokkaContext.kt +++ b/core/src/main/kotlin/plugability/DokkaContext.kt @@ -2,7 +2,8 @@ package org.jetbrains.dokka.plugability import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.EnvironmentAndFacade -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.utilities.DokkaLogger import java.io.File import java.net.URLClassLoader @@ -19,9 +20,10 @@ interface DokkaContext { fun <T, E> single(point: E): T where T : Any, E : ExtensionPoint<T> + val sourceSetCache: SourceSetCache val logger: DokkaLogger val configuration: DokkaConfiguration - val platforms: Map<PlatformData, EnvironmentAndFacade> + val platforms: Map<SourceSetData, EnvironmentAndFacade> val unusedPoints: Collection<ExtensionPoint<*>> @@ -29,10 +31,11 @@ interface DokkaContext { fun create( configuration: DokkaConfiguration, logger: DokkaLogger, - platforms: Map<PlatformData, EnvironmentAndFacade>, + sourceSets: Map<SourceSetData, EnvironmentAndFacade>, + sourceSetsCache: SourceSetCache, pluginOverrides: List<DokkaPlugin> ): DokkaContext = - DokkaContextConfigurationImpl(logger, configuration, platforms).apply { + DokkaContextConfigurationImpl(logger, configuration, sourceSets, sourceSetsCache).apply { // File(it.path) is a workaround for an incorrect filesystem in a File instance returned by Gradle. configuration.pluginsClasspath.map { File(it.path).toURI().toURL() } .toTypedArray() @@ -56,7 +59,8 @@ interface DokkaContextConfiguration { private class DokkaContextConfigurationImpl( override val logger: DokkaLogger, override val configuration: DokkaConfiguration, - override val platforms: Map<PlatformData, EnvironmentAndFacade> + override val platforms: Map<SourceSetData, EnvironmentAndFacade>, + override val sourceSetCache: SourceSetCache ) : DokkaContext, DokkaContextConfiguration { private val plugins = mutableMapOf<KClass<*>, DokkaPlugin>() private val pluginStubs = mutableMapOf<KClass<*>, DokkaPlugin>() diff --git a/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt b/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt index dfb1f26b..b67a1d57 100644 --- a/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt +++ b/core/src/main/kotlin/transformers/documentation/PreMergeDocumentableTransformer.kt @@ -4,5 +4,5 @@ import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext interface PreMergeDocumentableTransformer { - operator fun invoke(modules: List<DModule>, context: DokkaContext): List<DModule> + operator fun invoke(modules: List<DModule>): List<DModule> }
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt index a138b3e2..f9c0a3d0 100644 --- a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt +++ b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt @@ -1,9 +1,9 @@ package org.jetbrains.dokka.transformers.sources import org.jetbrains.dokka.model.DModule -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.plugability.DokkaContext interface SourceToDocumentableTranslator { - fun invoke(platformData: PlatformData, context: DokkaContext): DModule + fun invoke(sourceSet: SourceSetData, context: DokkaContext): DModule }
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt index 2da3fbd4..ab7d089d 100644 --- a/plugins/base/src/main/kotlin/DokkaBase.kt +++ b/plugins/base/src/main/kotlin/DokkaBase.kt @@ -54,15 +54,15 @@ class DokkaBase : DokkaPlugin() { } val preMergeDocumentableTransformer by extending(isFallback = true) { - CoreExtensions.preMergeDocumentableTransformer with DocumentableVisibilityFilter + CoreExtensions.preMergeDocumentableTransformer providing ::DocumentableVisibilityFilter } val actualTypealiasAdder by extending { - CoreExtensions.preMergeDocumentableTransformer with ActualTypealiasAdder() + CoreExtensions.preMergeDocumentableTransformer providing ::ActualTypealiasAdder } val modulesAndPackagesDocumentation by extending(isFallback = true) { - CoreExtensions.preMergeDocumentableTransformer with ModuleAndPackageDocumentationTransformer + CoreExtensions.preMergeDocumentableTransformer providing ::ModuleAndPackageDocumentationTransformer } val kotlinSignatureProvider by extending(isFallback = true) { diff --git a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt index 925767ce..1340529c 100644 --- a/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/DefaultRenderer.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.base.renderers import kotlinx.coroutines.* import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.LocationProvider +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin @@ -26,7 +27,7 @@ abstract class DefaultRenderer<T>( abstract fun T.buildList( node: ContentList, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) abstract fun T.buildNewLine() @@ -34,7 +35,7 @@ abstract class DefaultRenderer<T>( abstract fun T.buildTable( node: ContentTable, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) abstract fun T.buildText(textNode: ContentText) @@ -49,7 +50,7 @@ abstract class DefaultRenderer<T>( open fun T.buildGroup( node: ContentGroup, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) = wrapGroup(node, pageContext) { node.children.forEach { it.build(this, pageContext, platformRestriction) } } @@ -59,7 +60,7 @@ abstract class DefaultRenderer<T>( open fun T.buildLinkText( nodes: List<ContentNode>, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) { nodes.forEach { it.build(this, pageContext, platformRestriction) } } @@ -71,7 +72,7 @@ abstract class DefaultRenderer<T>( open fun T.buildHeader( node: ContentHeader, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) { buildHeader(node.level) { node.children.forEach { it.build(this, pageContext, platformRestriction) } } } @@ -79,22 +80,22 @@ abstract class DefaultRenderer<T>( open fun ContentNode.build( builder: T, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) = builder.buildContentNode(this, pageContext, platformRestriction) open fun T.buildContentNode( node: ContentNode, pageContext: ContentPage, - platformRestriction: PlatformData? = null + platformRestriction: SourceSetData? = null ) { - if (platformRestriction == null || platformRestriction in node.platforms) { + if (platformRestriction == null || platformRestriction in node.sourceSets) { when (node) { is ContentText -> buildText(node) is ContentHeader -> buildHeader(node, pageContext, platformRestriction) is ContentCode -> buildCode(node.children, node.language, pageContext) is ContentDRILink -> - buildLink(locationProvider.resolve(node.address, node.platforms.toList(), pageContext)) { + buildLink(locationProvider.resolve(node.address, node.sourceSets.toList(), pageContext)) { buildLinkText(node.children, pageContext, platformRestriction) } is ContentResolvedLink -> buildLink(node.address) { @@ -154,4 +155,4 @@ abstract class DefaultRenderer<T>( } } -fun ContentPage.platforms() = this.content.platforms.toList()
\ No newline at end of file +fun ContentPage.platforms() = this.content.sourceSets.toList()
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index c061cabf..caabcda7 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -7,6 +7,7 @@ import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.DFunction +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin @@ -42,10 +43,10 @@ open class HtmlRenderer( override fun FlowContent.buildPlatformDependent(content: PlatformHintedContent, pageContext: ContentPage) { div("platform-hinted") { attributes["data-platform-hinted"] = "data-platform-hinted" - val contents = content.platforms.mapIndexed { index, platform -> + val contents = content.sourceSets.mapIndexed { index, platform -> platform to createHTML(prettyPrint = false).div(classes = "content") { if (index == 0) attributes["data-active"] = "" - attributes["data-togglable"] = platform.targets.joinToString("-") + attributes["data-togglable"] = platform.sourceSetName buildContentNode(content.inner, pageContext, platform) } } @@ -56,8 +57,8 @@ open class HtmlRenderer( contents.forEachIndexed { index, pair -> button(classes = "platform-bookmark") { if (index == 0) attributes["data-active"] = "" - attributes["data-toggle"] = pair.first.targets.joinToString("-") - text(pair.first.targets.joinToString(", ")); + attributes["data-toggle"] = pair.first.sourceSetName + text(pair.first.sourceSetName) } } } @@ -71,27 +72,27 @@ open class HtmlRenderer( override fun FlowContent.buildList( node: ContentList, pageContext: ContentPage, - platformRestriction: PlatformData? - ) = if (node.ordered) ol { buildListItems(node.children, pageContext, platformRestriction) } - else ul { buildListItems(node.children, pageContext, platformRestriction) } + sourceSetRestriction: SourceSetData? + ) = if (node.ordered) ol { buildListItems(node.children, pageContext, sourceSetRestriction) } + else ul { buildListItems(node.children, pageContext, sourceSetRestriction) } open fun OL.buildListItems( items: List<ContentNode>, pageContext: ContentPage, - platformRestriction: PlatformData? = null + sourceSetRestriction: SourceSetData? = null ) { items.forEach { if (it is ContentList) buildList(it, pageContext) else - li { it.build(this, pageContext, platformRestriction) } + li { it.build(this, pageContext, sourceSetRestriction) } } } open fun UL.buildListItems( items: List<ContentNode>, pageContext: ContentPage, - platformRestriction: PlatformData? = null + sourceSetRestriction: SourceSetData? = null ) { items.forEach { if (it is ContentList) @@ -118,64 +119,63 @@ open class HtmlRenderer( private fun FlowContent.buildRow( node: ContentGroup, pageContext: ContentPage, - platformRestriction: PlatformData? + sourceSetRestriction: SourceSetData? ) { node.children .filter { - platformRestriction == null || platformRestriction in it.platforms + sourceSetRestriction == null || sourceSetRestriction in it.sourceSets } .takeIf { it.isNotEmpty() } ?.let { div(classes = "table-row") { it.filter { it.dci.kind != ContentKind.Symbol }.takeIf { it.isNotEmpty() }?.let { div("main-subrow ${node.style.joinToString { it.toString().decapitalize() }}") { - it.filter { platformRestriction == null || platformRestriction in it.platforms } + it.filter { sourceSetRestriction == null || sourceSetRestriction in it.sourceSets } .forEach { when(it.dci.kind){ - ContentKind.PlatformDependantHint -> { + ContentKind.SourceSetDependantHint -> { div("platform-dependant-row keyValue"){ div() div("title"){ - it.build(this, pageContext, platformRestriction) + it.build(this, pageContext, sourceSetRestriction) } } } ContentKind.Main -> { div("title-row"){ - it.build(this, pageContext, platformRestriction) + it.build(this, pageContext, sourceSetRestriction) div() - if (ContentKind.shouldBePlatformTagged(node.dci.kind) && node.platforms.size == 1) { + if (ContentKind.shouldBePlatformTagged(node.dci.kind) && node.sourceSets.size == 1) { createPlatformTags(node) } else { div() } } } - else -> div { it.build(this, pageContext, platformRestriction) } + else -> div { it.build(this, pageContext, sourceSetRestriction) } } } } } it.filter { it.dci.kind == ContentKind.Symbol }.takeIf { it.isNotEmpty() }?.let { div("signature-subrow") { - div("signatures"){ + div("signatures") { it.forEach { - it.build(this, pageContext, platformRestriction) + it.build(this, pageContext, sourceSetRestriction) } } } } } - } + } } - private fun FlowContent.createPlatformTags( node: ContentNode ) { + private fun FlowContent.createPlatformTags(node: ContentNode) { div("platform-tags") { - node.platforms.forEach { + node.sourceSets.forEach { div("platform-tag") { - val targets = it.targets.joinToString(", ") - if( targets.equals("common", ignoreCase = true) ) classes = classes + "common" - text(it.targets.joinToString(", ")) + if (it.sourceSetName.equals("common", ignoreCase = true)) classes = classes + "common" + text(it.sourceSetName) } } } @@ -184,11 +184,11 @@ open class HtmlRenderer( override fun FlowContent.buildTable( node: ContentTable, pageContext: ContentPage, - platformRestriction: PlatformData? + sourceSetRestriction: SourceSetData? ) { div(classes = "table") { node.children.forEach { - buildRow(it, pageContext, platformRestriction) + buildRow(it, pageContext, sourceSetRestriction) } } } @@ -221,7 +221,7 @@ open class HtmlRenderer( fun FlowContent.buildLink( to: DRI, - platforms: List<PlatformData>, + platforms: List<SourceSetData>, from: PageNode? = null, block: FlowContent.() -> Unit ) = buildLink(locationProvider.resolve(to, platforms, from), block) diff --git a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt index 4b90cc8a..4048c11e 100644 --- a/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt +++ b/plugins/base/src/main/kotlin/renderers/html/NavigationPage.kt @@ -3,8 +3,8 @@ 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.model.SourceSetData import org.jetbrains.dokka.pages.PageNode -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RendererSpecificPage import org.jetbrains.dokka.pages.RenderingStrategy @@ -41,7 +41,7 @@ class NavigationPage(val root: NavigationNode) : RendererSpecificPage { class NavigationNode( val name: String, val dri: DRI, - val platforms: List<PlatformData>, + val platforms: List<SourceSetData>, val children: List<NavigationNode> ) diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt index 29c4a425..322f4927 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt @@ -4,6 +4,8 @@ import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin @@ -46,15 +48,14 @@ open class DefaultLocationProvider( override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = pathTo(node, context) + if (!skipExtension) extension else "" - override fun resolve(dri: DRI, platforms: List<PlatformData>, context: PageNode?): String = + override fun resolve(dri: DRI, sourceSets: List<SourceSetData>, context: PageNode?): String = pagesIndex[dri]?.let { resolve(it, context) } ?: // Not found in PageGraph, that means it's an external link getLocation(dri, this.dokkaContext.configuration.passesConfigurations .filter { passConfig -> - platforms.toSet() - .contains(PlatformData(passConfig.moduleName, passConfig.analysisPlatform, passConfig.targets)) - } // TODO: change targets to something better? + sourceSets.toSet().contains(dokkaContext.sourceSet(passConfig)) + } .groupBy({ it.jdkVersion }, { it.externalDocumentationLinks }) .map { it.key to it.value.flatten().distinct() }.toMap() ) diff --git a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt index 0814cb3e..c6c48d63 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/LocationProvider.kt @@ -1,12 +1,12 @@ package org.jetbrains.dokka.base.resolvers.local import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.pages.PageNode -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RootPageNode interface LocationProvider { - fun resolve(dri: DRI, platforms: List<PlatformData>, context: PageNode? = null): String + fun resolve(dri: DRI, sourceSets: List<SourceSetData>, context: PageNode? = null): String fun resolve(node: PageNode, context: PageNode? = null, skipExtension: Boolean = false): String fun resolveRoot(node: PageNode): String fun ancestors(node: PageNode): List<PageNode> diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 313973bf..241103bf 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -10,7 +10,6 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.ContentNode -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.TextStyle import org.jetbrains.dokka.utilities.DokkaLogger @@ -35,7 +34,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog link(e.name, e.dri) } - private fun actualTypealiasedSignature(dri: DRI, name: String, aliasedTypes: PlatformDependent<Bound>) = + private fun actualTypealiasedSignature(dri: DRI, name: String, aliasedTypes: SourceSetDependent<Bound>) = aliasedTypes.entries.groupBy({ it.value }, { it.key }).map { (bound, platforms) -> contentBuilder.contentFor(dri, platforms.toSet(), ContentKind.Symbol, setOf(TextStyle.Monospace)) { text("actual typealias ") @@ -49,17 +48,17 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog (c as? WithExtraProperties<out DClasslike>)?.let { c.extra[ActualTypealias]?.let { contentBuilder.contentFor(c) { - +regularSignature(c, platformData = c.platformData.toSet() - it.underlyingType.keys) + +regularSignature(c, sourceSets = c.sourceSets.toSet() - it.underlyingType.keys) +actualTypealiasedSignature(c.dri, c.name.orEmpty(), it.underlyingType) } } ?: regularSignature(c) } ?: regularSignature(c) - private fun regularSignature(c: DClasslike, platformData: Set<PlatformData> = c.platformData.toSet()) = - contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace), platformData = platformData) { - platformText(c.visibility, platformData) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } + private fun regularSignature(c: DClasslike, sourceSets: Set<SourceSetData> = c.sourceSets.toSet()) = + contentBuilder.contentFor(c, ContentKind.Symbol, setOf(TextStyle.Monospace), sourceSets = sourceSets) { + platformText(c.visibility, sourceSets) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } if (c is DClass) { - platformText(c.modifier, platformData) { + platformText(c.modifier, sourceSets) { if (c.extra[AdditionalModifiers]?.content?.contains(ExtraModifiers.DATA) == true && it.name == "final") "data " else it.name + " " } @@ -74,23 +73,23 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog link(c.name!!, c.dri) if (c is DClass) { val pConstructor = c.constructors.singleOrNull { it.extra[PrimaryConstructorExtra] != null } - list(pConstructor?.parameters.orEmpty(), "(", ")", ",", pConstructor?.platformData.orEmpty().toSet()) { + list(pConstructor?.parameters.orEmpty(), "(", ")", ",", pConstructor?.sourceSets.orEmpty().toSet()) { text(it.name ?: "", styles = mainStyles.plus(TextStyle.Bold).plus(TextStyle.Indented)) text(": ") signatureForProjection(it.type) } } if (c is WithSupertypes) { - c.supertypes.filter { it.key in platformData }.map { (p, dris) -> - list(dris, prefix = " : ", platformData = setOf(p)) { - link(it.sureClassNames, it, platformData = setOf(p)) + c.supertypes.filter { it.key in sourceSets }.map { (p, dris) -> + list(dris, prefix = " : ", sourceSets = setOf(p)) { + link(it.sureClassNames, it, sourceSets = setOf(p)) } } } } - private fun propertySignature(p: DProperty, platformData: Set<PlatformData> = p.platformData.toSet()) = - contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace), platformData = platformData) { + private fun propertySignature(p: DProperty, sourceSets: Set<SourceSetData> = p.sourceSets.toSet()) = + contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace), sourceSets = sourceSets) { platformText(p.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } platformText(p.modifier){ it.name + " "} p.setter?.let { text("var ") } ?: text("val ") @@ -106,8 +105,8 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog signatureForProjection(p.type) } - private fun functionSignature(f: DFunction, platformData: Set<PlatformData> = f.platformData.toSet()) = - contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace), platformData = platformData) { + private fun functionSignature(f: DFunction, sourceSets: Set<SourceSetData> = f.sourceSets.toSet()) = + contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace), sourceSets = sourceSets) { platformText(f.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } platformText(f.modifier) { it.name + " " } text("fun ") @@ -147,7 +146,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog t, ContentKind.Symbol, setOf(TextStyle.Monospace), - platformData = platforms.toSet() + sourceSets = platforms.toSet() ) { platformText(t.visibility) { (it.takeIf { it !in ignoredVisibilities }?.name ?: "") + " " } text("typealias ") @@ -196,8 +195,8 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog is PrimitiveJavaType -> signatureForProjection(p.translateToKotlin()) } - private fun funType(dri: DRI, platformData: Set<PlatformData>, type: TypeConstructor) = - contentBuilder.contentFor(dri, platformData, ContentKind.Symbol, setOf(TextStyle.Monospace)) { + private fun funType(dri: DRI, sourceSets: Set<SourceSetData>, type: TypeConstructor) = + contentBuilder.contentFor(dri, sourceSets, ContentKind.Symbol, setOf(TextStyle.Monospace)) { if (type.extension) { signatureForProjection(type.projections.first()) text(".") diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt index 35f27a94..cab4a9d2 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ActualTypealiasAdder.kt @@ -6,8 +6,8 @@ import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -class ActualTypealiasAdder : PreMergeDocumentableTransformer { - override fun invoke(modules: List<DModule>, context: DokkaContext) = modules.map { it.mergeTypealiases() } +class ActualTypealiasAdder(val context: DokkaContext) : PreMergeDocumentableTransformer { + override fun invoke(modules: List<DModule>) = modules.map { it.mergeTypealiases() } private fun DModule.mergeTypealiases(): DModule = copy(packages = packages.map { pkg -> if (pkg.typealiases.isEmpty()) { @@ -64,11 +64,11 @@ class ActualTypealiasAdder : PreMergeDocumentableTransformer { typealiases: Map<DRI, DTypeAlias> ): List<T> where T : DClasslike, T : WithExtraProperties<T>, T : WithExpectActual = elements.map { element -> - if (element.sources.expect != null) { + if (element.expectPresentInSet != null) { typealiases[element.dri]?.let { ta -> element.withNewExtras( element.extra + ActualTypealias( - PlatformDependent.from(ta.platformData.single(), ta.underlyingType.values.single()) + mapOf(ta.sourceSets.single() to ta.underlyingType.values.single()) ) ) } ?: element diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt index f871cdec..862f9240 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DefaultDocumentableMerger.kt @@ -2,7 +2,6 @@ package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.mergeExtras -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableMerger import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult @@ -24,8 +23,9 @@ internal object DefaultDocumentableMerger : DocumentableMerger { list.flatMap { it.packages }, DPackage::mergeWith ), - documentation = list.platformDependentFor { documentation }, - platformData = list.flatMap { it.platformData }.distinct() + documentation = list.map { it.documentation }.flatMap { it.entries }.associate { (k,v) -> k to v }, + expectPresentInSet = list.firstNotNullResult { it.expectPresentInSet }, + sourceSets = list.flatMap { it.sourceSets } ).mergeExtras(left, right) } } @@ -36,115 +36,51 @@ private fun <T : Documentable> merge(elements: List<T>, reducer: (T, T) -> T): L .reduce { _, left, right -> reducer(left, right) } .values.toList() -private fun <T : Any, D : Documentable> Iterable<D>.platformDependentFor( - selector: D.() -> PlatformDependent<T> -): PlatformDependent<T> { - val actuals = map { it.selector().map } - .flatMap { it.entries } - .associate { (k, v) -> k to v } - - val expected = firstNotNullResult { it.selector().expect } - - return PlatformDependent(actuals, expected) -} - -private fun <T : Any> PlatformDependent<T>.mergeWith(other: PlatformDependent<T>) = PlatformDependent( - map = this + other, - expect = expect ?: other.expect -) - private fun <T> mergeExpectActual( elements: List<T>, - reducer: (T, T) -> T, - platformSetter: T.(List<PlatformData>) -> T + reducer: (T, T) -> T ): List<T> where T : Documentable, T : WithExpectActual { - fun findExpect(actual: T, expects: List<T>): Expect<T> = - expects.find { it.platformData.flatMap { it.targets }.containsAll(actual.platformData.flatMap { it.targets }) } - .let { Expect.from(it) } - - fun reduceExpectActual(entry: Map.Entry<Expect<T>, List<T>>): List<T> = when (val expect = entry.key) { - Expect.NotFound -> entry.value - is Expect.Found -> entry.value.plus(expect.expect).reduce(reducer).let(::listOf) - } - - fun analyzeExpectActual(sameDriElements: List<T>): List<T> { - val pathGrouped: Collection<T> = mutableMapOf<Set<String>, T>().apply { - sameDriElements.forEach { documentable -> - val paths = documentable.sources.allValues.map { it.path }.toSet() - val key = keys.find { it.containsAll(paths) } - if (key == null) { - put(paths, documentable) - } else { - computeIfPresent(key) { _, old -> reducer(old, documentable) } - } - } - }.values - val (expect, actual) = pathGrouped.partition { it.sources.expect != null } - val mergedExpect = expect.groupBy { it.sources.expect?.path }.values.map { e -> - e.first().platformSetter(e.flatMap { it.platformData }.distinct()) - } - val groupExpectActual = actual.groupBy { findExpect(it, mergedExpect) } - val pathsToExpects: Set<String> = - groupExpectActual.keys.filterIsInstance<Expect.Found<T>>() - .mapNotNull { it.expect.sources.expect?.path }.toSet() + fun analyzeExpectActual(sameDriElements: List<T>) = sameDriElements.reduce(reducer) - return groupExpectActual.flatMap { reduceExpectActual(it) } + expect.filterNot { it.sources.expect?.path in pathsToExpects } - } - - return elements.groupBy { it.dri }.values.flatMap(::analyzeExpectActual) -} - -private sealed class Expect<out T : Any> { - object NotFound : Expect<Nothing>() - data class Found<T : Any>(val expect: T) : Expect<T>() - - companion object { - fun <T : Any> from(t: T?) = t?.let(::Found) ?: NotFound - } + return elements.groupBy { it.dri }.values.map(::analyzeExpectActual) } fun DPackage.mergeWith(other: DPackage): DPackage = copy( - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), - documentation = documentation.mergeWith(other.documentation), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, typealiases = merge(typealiases + other.typealiases, DTypeAlias::mergeWith), - platformData = (platformData + other.platformData).distinct() + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DFunction.mergeWith(other: DFunction): DFunction = copy( parameters = merge(this.parameters + other.parameters, DParameter::mergeWith), receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver, - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - modifier = modifier.mergeWith(other.modifier), - platformData = (platformData + other.platformData).distinct(), + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + modifier = modifier + other.modifier, + sourceSets = sourceSets + other.sourceSets, generics = merge(generics + other.generics, DTypeParameter::mergeWith) ).mergeExtras(this, other) fun DProperty.mergeWith(other: DProperty): DProperty = copy( receiver = receiver?.let { r -> other.receiver?.let { r.mergeWith(it) } ?: r } ?: other.receiver, - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - modifier = modifier.mergeWith(other.modifier), - platformData = (platformData + other.platformData).distinct(), + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + modifier = modifier + other.modifier, + sourceSets = sourceSets + other.sourceSets, getter = getter?.let { g -> other.getter?.let { g.mergeWith(it) } ?: g } ?: other.getter, setter = setter?.let { s -> other.setter?.let { s.mergeWith(it) } ?: s } ?: other.setter, generics = merge(generics + other.generics, DTypeParameter::mergeWith) ).mergeExtras(this, other) -fun DClasslike.setPlatformData(platformData: List<PlatformData>): DClasslike = when (this) { - is DClass -> copy(platformData = platformData) - is DEnum -> copy(platformData = platformData) - is DInterface -> copy(platformData = platformData) - is DObject -> copy(platformData = platformData) - is DAnnotation -> copy(platformData = platformData) - else -> throw IllegalStateException("${this::class.qualifiedName} ${this.name} cannot have platform set") -} - fun DClasslike.mergeWith(other: DClasslike): DClasslike = when { this is DClass && other is DClass -> mergeWith(other) this is DEnum && other is DEnum -> mergeWith(other) @@ -158,18 +94,19 @@ fun DClass.mergeWith(other: DClass): DClass = copy( constructors = mergeExpectActual( constructors + other.constructors, DFunction::mergeWith - ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), + ), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, generics = merge(generics + other.generics, DTypeParameter::mergeWith), - modifier = modifier.mergeWith(other.modifier), - supertypes = supertypes.mergeWith(other.supertypes), - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + modifier = modifier + other.modifier, + supertypes = supertypes + other.supertypes, + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DEnum.mergeWith(other: DEnum): DEnum = copy( @@ -177,78 +114,86 @@ fun DEnum.mergeWith(other: DEnum): DEnum = copy( constructors = mergeExpectActual( constructors + other.constructors, DFunction::mergeWith - ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), + ), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, - supertypes = supertypes.mergeWith(other.supertypes), - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + supertypes = supertypes + other.supertypes, + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DEnumEntry.mergeWith(other: DEnumEntry): DEnumEntry = copy( - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), - documentation = documentation.mergeWith(other.documentation), - platformData = (platformData + other.platformData).distinct() + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DObject.mergeWith(other: DObject): DObject = copy( - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), - supertypes = supertypes.mergeWith(other.supertypes), - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), + supertypes = supertypes + other.supertypes, + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DInterface.mergeWith(other: DInterface): DInterface = copy( - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, generics = merge(generics + other.generics, DTypeParameter::mergeWith), - supertypes = supertypes.mergeWith(other.supertypes), - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + supertypes = supertypes + other.supertypes, + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DAnnotation.mergeWith(other: DAnnotation): DAnnotation = copy( constructors = mergeExpectActual( constructors + other.constructors, DFunction::mergeWith - ) { copy(platformData = it) }, - functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith) { copy(platformData = it) }, - properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith) { copy(platformData = it) }, - classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith, DClasslike::setPlatformData), + ), + functions = mergeExpectActual(functions + other.functions, DFunction::mergeWith), + properties = mergeExpectActual(properties + other.properties, DProperty::mergeWith), + classlikes = mergeExpectActual(classlikes + other.classlikes, DClasslike::mergeWith), companion = companion?.let { c -> other.companion?.let { c.mergeWith(it) } ?: c } ?: other.companion, - documentation = documentation.mergeWith(other.documentation), - sources = sources.mergeWith(other.sources), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sources = sources+ other.sources, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DParameter.mergeWith(other: DParameter): DParameter = copy( - documentation = documentation.mergeWith(other.documentation), - platformData = (platformData + other.platformData).distinct() + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DTypeParameter.mergeWith(other: DTypeParameter): DTypeParameter = copy( - documentation = documentation.mergeWith(other.documentation), - platformData = (platformData + other.platformData).distinct() + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other) fun DTypeAlias.mergeWith(other: DTypeAlias): DTypeAlias = copy( - documentation = documentation.mergeWith(other.documentation), - underlyingType = underlyingType.mergeWith(other.underlyingType), - visibility = visibility.mergeWith(other.visibility), - platformData = (platformData + other.platformData).distinct() + documentation = documentation + other.documentation, + expectPresentInSet = expectPresentInSet ?: other.expectPresentInSet, + underlyingType = underlyingType + other.underlyingType, + visibility = visibility + other.visibility, + sourceSets = sourceSets + other.sourceSets ).mergeExtras(this, other)
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt index c261d2dc..6fdce3a8 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/DocumentableVisibilityFilter.kt @@ -5,15 +5,14 @@ import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.DAnnotation import org.jetbrains.dokka.model.DEnum import org.jetbrains.dokka.model.DFunction -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer -internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { +internal class DocumentableVisibilityFilter(val context: DokkaContext) : PreMergeDocumentableTransformer { - override fun invoke(modules: List<DModule>, context: DokkaContext): List<DModule> = modules.map { original -> + override fun invoke(modules: List<DModule>): List<DModule> = modules.map { original -> val packageOptions = - context.configuration.passesConfigurations.first { original.platformData.contains(it.platformData) } + context.configuration.passesConfigurations.first { original.sourceSets.contains(context.sourceSet(it)) } .perPackageOptions DocumentableFilter(packageOptions).processModule(original) @@ -36,7 +35,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { original.name, packages = packages, documentation = original.documentation, - platformData = original.platformData, + sourceSets = original.sourceSets, extra = original.extra ) } @@ -69,7 +68,8 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { classlikes, it.typealiases, it.documentation, - it.platformData, + it.expectPresentInSet, + it.sourceSets, it.extra ) } @@ -78,26 +78,25 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { return Pair(packagesListChanged, filteredPackages) } - private fun <T : WithVisibility> alwaysTrue(a: T, p: PlatformData) = true - private fun <T : WithVisibility> alwaysFalse(a: T, p: PlatformData) = false + private fun <T : WithVisibility> alwaysTrue(a: T, p: SourceSetData) = true + private fun <T : WithVisibility> alwaysFalse(a: T, p: SourceSetData) = false - private fun WithVisibility.visibilityForPlatform(data: PlatformData): Visibility? = - visibility[data] ?: visibility.expect + private fun WithVisibility.visibilityForPlatform(data: SourceSetData): Visibility? = visibility[data] private fun <T> T.filterPlatforms( - additionalCondition: (T, PlatformData) -> Boolean = ::alwaysTrue, - alternativeCondition: (T, PlatformData) -> Boolean = ::alwaysFalse + additionalCondition: (T, SourceSetData) -> Boolean = ::alwaysTrue, + alternativeCondition: (T, SourceSetData) -> Boolean = ::alwaysFalse ) where T : Documentable, T : WithVisibility = - platformData.filter { d -> + sourceSets.filter { d -> visibilityForPlatform(d)?.isAllowedInPackage(dri.packageName) == true && additionalCondition(this, d) || alternativeCondition(this, d) } private fun <T> List<T>.transform( - additionalCondition: (T, PlatformData) -> Boolean = ::alwaysTrue, - alternativeCondition: (T, PlatformData) -> Boolean = ::alwaysFalse, - recreate: (T, List<PlatformData>) -> T + additionalCondition: (T, SourceSetData) -> Boolean = ::alwaysTrue, + alternativeCondition: (T, SourceSetData) -> Boolean = ::alwaysFalse, + recreate: (T, List<SourceSetData>) -> T ): Pair<Boolean, List<T>> where T : Documentable, T : WithVisibility { var changed = false val values = mapNotNull { t -> @@ -119,7 +118,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { private fun filterFunctions( functions: List<DFunction>, - additionalCondition: (DFunction, PlatformData) -> Boolean = ::alwaysTrue + additionalCondition: (DFunction, SourceSetData) -> Boolean = ::alwaysTrue ) = functions.transform(additionalCondition) { original, filteredPlatforms -> with(original) { @@ -129,6 +128,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { isConstructor, parameters, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), visibility.filtered(filteredPlatforms), type, @@ -141,13 +141,13 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { } } - private fun hasVisibleAccessorsForPlatform(property: DProperty, data: PlatformData) = + private fun hasVisibleAccessorsForPlatform(property: DProperty, data: SourceSetData) = property.getter?.visibilityForPlatform(data)?.isAllowedInPackage(property.dri.packageName) == true || property.setter?.visibilityForPlatform(data)?.isAllowedInPackage(property.dri.packageName) == true private fun filterProperties( properties: List<DProperty>, - additionalCondition: (DProperty, PlatformData) -> Boolean = ::alwaysTrue + additionalCondition: (DProperty, SourceSetData) -> Boolean = ::alwaysTrue ): Pair<Boolean, List<DProperty>> = properties.transform(additionalCondition, ::hasVisibleAccessorsForPlatform) { original, filteredPlatforms -> with(original) { @@ -155,6 +155,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { dri, name, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), visibility.filtered(filteredPlatforms), type, @@ -169,16 +170,17 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { } } - private fun filterEnumEntries(entries: List<DEnumEntry>, filteredPlatforms: List<PlatformData>) = + private fun filterEnumEntries(entries: List<DEnumEntry>, filteredPlatforms: List<SourceSetData>) = entries.mapNotNull { entry -> - if (filteredPlatforms.containsAll(entry.platformData)) entry + if (filteredPlatforms.containsAll(entry.sourceSets)) entry else { - val intersection = filteredPlatforms.intersect(entry.platformData).toList() + val intersection = filteredPlatforms.intersect(entry.sourceSets).toList() if (intersection.isEmpty()) null else DEnumEntry( entry.dri, entry.name, entry.documentation.filtered(intersection), + entry.expectPresentInSet.filtered(filteredPlatforms), filterFunctions(entry.functions) { _, data -> data in intersection }.second, filterProperties(entry.properties) { _, data -> data in intersection }.second, filterClasslikes(entry.classlikes) { _, data -> data in intersection }.second, @@ -190,7 +192,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { private fun filterClasslikes( classlikeList: List<DClasslike>, - additionalCondition: (DClasslike, PlatformData) -> Boolean = ::alwaysTrue + additionalCondition: (DClasslike, SourceSetData) -> Boolean = ::alwaysTrue ): Pair<Boolean, List<DClasslike>> { var classlikesListChanged = false val filteredClasslikes: List<DClasslike> = classlikeList.mapNotNull { @@ -200,7 +202,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { classlikesListChanged = true null } else { - var modified = platformData.size != filteredPlatforms.size + var modified = sourceSets.size != filteredPlatforms.size val functions = filterFunctions(functions) { _, data -> data in filteredPlatforms }.let { (listModified, list) -> modified = modified || listModified @@ -246,6 +248,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { generics, supertypes.filtered(filteredPlatforms), documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), modifier, filteredPlatforms, extra @@ -254,6 +257,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { name, dri, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), functions, properties, @@ -269,6 +273,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { name, enumEntries, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), functions, properties, @@ -284,6 +289,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { dri, name, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), functions, properties, @@ -299,6 +305,7 @@ internal object DocumentableVisibilityFilter : PreMergeDocumentableTransformer { name, dri, documentation.filtered(filteredPlatforms), + expectPresentInSet.filtered(filteredPlatforms), sources.filtered(filteredPlatforms), functions, properties, diff --git a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt index 9cc09d89..15ffc08a 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/InheritorsExtractorTransformer.kt @@ -4,7 +4,6 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.ExtraProperty import org.jetbrains.dokka.model.properties.MergeStrategy -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer @@ -12,8 +11,8 @@ class InheritorsExtractorTransformer : DocumentableTransformer { override fun invoke(original: DModule, context: DokkaContext): DModule = original.generateInheritanceMap().let { inheritanceMap -> original.appendInheritors(inheritanceMap) as DModule } - private fun <T : Documentable> T.appendInheritors(inheritanceMap: Map<PlatformData, Map<DRI, List<DRI>>>): Documentable = - InheritorsInfo(PlatformDependent(inheritanceMap.getForDRI(dri))).let { info -> + private fun <T : Documentable> T.appendInheritors(inheritanceMap: Map<SourceSetData, Map<DRI, List<DRI>>>): Documentable = + InheritorsInfo(inheritanceMap.getForDRI(dri)).let { info -> when (this) { is DModule -> copy(packages = packages.map { it.appendInheritors(inheritanceMap) as DPackage }) is DPackage -> copy(classlikes = classlikes.map { it.appendInheritors(inheritanceMap) as DClasslike }) @@ -44,12 +43,12 @@ class InheritorsExtractorTransformer : DocumentableTransformer { } } - private fun InheritorsInfo.isNotEmpty() = this.value.allValues.fold(0) { acc, list -> acc + list.size } > 0 + private fun InheritorsInfo.isNotEmpty() = this.value.values.fold(0) { acc, list -> acc + list.size } > 0 - private fun Map<PlatformData, Map<DRI, List<DRI>>>.getForDRI(dri: DRI) = - PlatformDependent(map { (v, k) -> + private fun Map<SourceSetData, Map<DRI, List<DRI>>>.getForDRI(dri: DRI) = + map { (v, k) -> v to k[dri] - }.map { (k, v) -> k to v.orEmpty() }.toMap()) + }.map { (k, v) -> k to v.orEmpty() }.toMap() private fun DModule.generateInheritanceMap() = getInheritanceEntriesRec().filterNot { it.second.isEmpty() }.groupBy({ it.first }) { it.second } @@ -58,26 +57,24 @@ class InheritorsExtractorTransformer : DocumentableTransformer { .groupBy({ it.first }) { it.second }.map { (k2, v2) -> k2 to v2.flatten() }.toMap() }.filter { it.second.values.isNotEmpty() }.toMap() - private fun <T : Documentable> T.getInheritanceEntriesRec(): List<Pair<PlatformData, List<Pair<DRI, DRI>>>> = + private fun <T : Documentable> T.getInheritanceEntriesRec(): List<Pair<SourceSetData, List<Pair<DRI, DRI>>>> = this.toInheritanceEntries() + children.flatMap { it.getInheritanceEntriesRec() } private fun <T : Documentable> T.toInheritanceEntries() = (this as? WithSupertypes)?.let { - it.supertypes.map.map { (k, v) -> k to v.map { it to dri } } + it.supertypes.map { (k, v) -> k to v.map { it to dri } } }.orEmpty() } -class InheritorsInfo(val value: PlatformDependent<List<DRI>>) : ExtraProperty<Documentable> { +class InheritorsInfo(val value: SourceSetDependent<List<DRI>>) : ExtraProperty<Documentable> { companion object : ExtraProperty.Key<Documentable, InheritorsInfo> { override fun mergeStrategyFor(left: InheritorsInfo, right: InheritorsInfo): MergeStrategy<Documentable> = MergeStrategy.Replace( InheritorsInfo( - PlatformDependent( - (left.value.map.entries.toList() + right.value.map.entries.toList()) + (left.value.entries.toList() + right.value.entries.toList()) .groupBy({ it.key }) { it.value } .map { (k, v) -> k to v.flatten() }.toMap() - ) ) ) } diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index b69c43d3..a886494e 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -1,9 +1,9 @@ package org.jetbrains.dokka.base.transformers.documentables import org.jetbrains.dokka.model.DModule -import org.jetbrains.dokka.model.PlatformDependent +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.DocumentationNode -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.parsers.MarkdownParser import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer @@ -12,14 +12,14 @@ import java.nio.file.Files import java.nio.file.Paths -internal object ModuleAndPackageDocumentationTransformer : PreMergeDocumentableTransformer { +internal class ModuleAndPackageDocumentationTransformer(val context: DokkaContext) : PreMergeDocumentableTransformer { - override fun invoke(original: List<DModule>, context: DokkaContext): List<DModule> { + override fun invoke(original: List<DModule>): List<DModule> { val modulesAndPackagesDocumentation = context.configuration.passesConfigurations .map { - Pair(it.moduleName, it.platformData) to + Pair(it.moduleName, context.sourceSet(it)) to it.includes.map { Paths.get(it) } .also { it.forEach { @@ -50,10 +50,10 @@ internal object ModuleAndPackageDocumentationTransformer : PreMergeDocumentableT return original.map { module -> val moduleDocumentation = - module.platformData.mapNotNull { pd -> + module.sourceSets.mapNotNull { pd -> val doc = modulesAndPackagesDocumentation[Pair(module.name, pd)] val facade = context.platforms[pd]?.facade - ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.name}") } + ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetName}") } try { doc?.get("Module")?.get(module.name)?.run { pd to MarkdownParser( @@ -68,15 +68,15 @@ internal object ModuleAndPackageDocumentationTransformer : PreMergeDocumentableT } }.toMap() - val packagesDocumentation = module.packages.map { dPackage -> - dPackage.name to dPackage.platformData.mapNotNull { platformData -> - val doc = modulesAndPackagesDocumentation[Pair(module.name, platformData)] - val facade = context.platforms[platformData]?.facade - ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${platformData.name}") } - val descriptor = facade.resolveSession.getPackageFragment(FqName(dPackage.name)) - ?: return@mapNotNull null.also { context.logger.warn("Could not find descriptor for ${dPackage.name}") } - doc?.get("Package")?.get(dPackage.name)?.run { - platformData to MarkdownParser( + val packagesDocumentation = module.packages.map { + it.name to it.sourceSets.mapNotNull { pd -> + val doc = modulesAndPackagesDocumentation[Pair(module.name, pd)] + val facade = context.platforms[pd]?.facade + ?: return@mapNotNull null.also { context.logger.warn("Could not find platform data for ${pd.moduleName}/${pd.sourceSetName}") } + val descriptor = facade.resolveSession.getPackageFragment(FqName(it.name)) + ?: return@mapNotNull null.also { context.logger.warn("Could not find descriptor for $") } + doc?.get("Package")?.get(it.name)?.run { + pd to MarkdownParser( facade, descriptor, context.logger @@ -86,13 +86,11 @@ internal object ModuleAndPackageDocumentationTransformer : PreMergeDocumentableT }.toMap() module.copy( - documentation = module.documentation.let { mergeDocumentation(it.map, moduleDocumentation) }, + documentation = mergeDocumentation(module.documentation, moduleDocumentation), packages = module.packages.map { val packageDocumentation = packagesDocumentation[it.name] if (packageDocumentation != null && packageDocumentation.isNotEmpty()) - it.copy(documentation = it.documentation.let { value -> - mergeDocumentation(value.map, packageDocumentation) - }) + it.copy(documentation = mergeDocumentation(it.documentation, packageDocumentation)) else it } @@ -100,10 +98,10 @@ internal object ModuleAndPackageDocumentationTransformer : PreMergeDocumentableT } } - private fun mergeDocumentation(origin: Map<PlatformData, DocumentationNode>, new: Map<PlatformData, DocumentationNode>) = PlatformDependent( + private fun mergeDocumentation(origin: Map<SourceSetData, DocumentationNode>, new: Map<SourceSetData, DocumentationNode>) = (origin.asSequence() + new.asSequence()) .distinct() .groupBy({ it.key }, { it.value }) .mapValues { (_, values) -> DocumentationNode(values.flatMap { it.children }) } - ) + } diff --git a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt index 778e0498..cb74441e 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/CommentsToContentConverter.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.base.transformers.pages.comments +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.DocTag import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* @@ -8,7 +9,7 @@ interface CommentsToContentConverter { fun buildContent( docTag: DocTag, dci: DCI, - platforms: Set<PlatformData>, + platforms: Set<SourceSetData>, styles: Set<Style> = emptySet(), extras: PropertyContainer<ContentNode> = PropertyContainer.empty() ): List<ContentNode> 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 4e65bae9..85391549 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/comments/DocTagToContentConverter.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.base.transformers.pages.comments +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* @@ -8,19 +9,19 @@ object DocTagToContentConverter : CommentsToContentConverter { override fun buildContent( docTag: DocTag, dci: DCI, - platforms: Set<PlatformData>, + sourceSets: Set<SourceSetData>, styles: Set<Style>, extra: PropertyContainer<ContentNode> ): List<ContentNode> { fun buildChildren(docTag: DocTag, newStyles: Set<Style> = emptySet(), newExtras: SimpleAttr? = null) = docTag.children.flatMap { - buildContent(it, dci, platforms, styles + newStyles, newExtras?.let { extra + it } ?: extra) + buildContent(it, dci, sourceSets, styles + newStyles, newExtras?.let { extra + it } ?: extra) } fun buildTableRows(rows: List<DocTag>, newStyle: Style): List<ContentGroup> = rows.flatMap { - buildContent(it, dci, platforms, styles + newStyle, extra) as List<ContentGroup> + buildContent(it, dci, sourceSets, styles + newStyle, extra) as List<ContentGroup> } fun buildHeader(level: Int) = @@ -29,7 +30,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), level, dci, - platforms, + sourceSets, styles ) ) @@ -40,7 +41,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), ordered, dci, - platforms, + sourceSets, styles, ((PropertyContainer.empty<ContentNode>()) + SimpleAttr("start", start.toString())) ) @@ -48,7 +49,7 @@ object DocTagToContentConverter : CommentsToContentConverter { fun buildNewLine() = listOf( ContentBreakLine( - platforms + sourceSets ) ) @@ -71,7 +72,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), docTag.params.get("href")!!, dci, - platforms, + sourceSets, styles ) ) @@ -83,7 +84,7 @@ object DocTagToContentConverter : CommentsToContentConverter { setOf(docTag.dri), ContentKind.Symbol ), - platforms, + sourceSets, styles ) ) @@ -92,7 +93,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - platforms, + sourceSets, styles ) ) @@ -101,7 +102,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildChildren(docTag), "", dci, - platforms, + sourceSets, styles ) ) @@ -110,7 +111,7 @@ object DocTagToContentConverter : CommentsToContentConverter { address = docTag.params["href"]!!, altText = docTag.params["alt"], dci = dci, - platforms = platforms, + sourceSets = sourceSets, style = styles, extra = extra ) @@ -119,7 +120,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( "", dci, - platforms, + sourceSets, setOf() ) ) @@ -127,7 +128,7 @@ object DocTagToContentConverter : CommentsToContentConverter { ContentText( docTag.body, dci, - platforms, + sourceSets, styles ) ) @@ -137,7 +138,7 @@ object DocTagToContentConverter : CommentsToContentConverter { buildTableRows(docTag.children.filterIsInstance<Th>(), CommentTable), buildTableRows(docTag.children.filterIsInstance<Tr>(), CommentTable), dci, - platforms, + sourceSets, styles + CommentTable ) ) @@ -145,10 +146,10 @@ object DocTagToContentConverter : CommentsToContentConverter { is Tr -> listOf( ContentGroup( docTag.children.map { - ContentGroup(buildChildren(it), dci, platforms, styles, extra) + ContentGroup(buildChildren(it), dci, sourceSets, styles, extra) }, dci, - platforms, + sourceSets, styles ) ) diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt index fb904f47..31e79555 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt @@ -32,6 +32,6 @@ object SameMethodNamePageMergerStrategy : PageMergerStrategy { } fun asGroup(dci: DCI, nodes: List<ContentNode>): ContentGroup = - nodes.first().let { ContentGroup(nodes, dci, it.platforms, it.style, it.extra) } + nodes.first().let { ContentGroup(nodes, dci, it.sourceSets, it.style, it.extra) } }
\ No newline at end of file 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 78fc4d33..9b04af40 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/samples/SamplesTransformer.kt @@ -8,8 +8,10 @@ import org.jetbrains.dokka.analysis.AnalysisEnvironment import org.jetbrains.dokka.analysis.DokkaResolutionFacade import org.jetbrains.dokka.base.renderers.platforms import org.jetbrains.dokka.links.DRI +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.Sample import org.jetbrains.dokka.model.properties.PropertyContainer +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer @@ -31,16 +33,16 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { val analysis = setUpAnalysis(context) return input.transformContentPagesTree { page -> - page.documentable?.documentation?.allEntries?.fold(page) { acc, entry -> - entry.second.children.filterIsInstance<Sample>().fold(acc) { acc, sample -> - acc.modified(content = acc.content.addSample(page, entry.first, sample.name, analysis)) + page.documentable?.documentation?.entries?.fold(page) { acc, entry -> + entry.value.children.filterIsInstance<Sample>().fold(acc) { acc, sample -> + acc.modified(content = acc.content.addSample(page, entry.key, sample.name, analysis)) } } ?: page } } private fun setUpAnalysis(context: DokkaContext) = context.configuration.passesConfigurations.map { - it.platformData to AnalysisEnvironment(DokkaGenerator.DokkaMessageCollector(context.logger), it.analysisPlatform).run { + context.sourceSet(it) to AnalysisEnvironment(DokkaGenerator.DokkaMessageCollector(context.logger), it.analysisPlatform).run { if (analysisPlatform == Platform.jvm) { addClasspath(PathUtil.getJdkClassesRootsFromCurrentJre()) } @@ -56,12 +58,9 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { } }.toMap() - private fun ContentNode.addSample(contentPage: ContentPage, platform: PlatformData?, fqName: String, analysis: Map<PlatformData, EnvironmentAndFacade>): ContentNode { - val facade = if(platform == null) { - analysis.entries.find { it.key.platformType.name == "common" }?.value - } else { - analysis[platform] - }?.facade ?: return this.also { context.logger.warn("Cannot resolve facade for platform ${platform?.name ?: "expect"}") } + private fun ContentNode.addSample(contentPage: ContentPage, platform: SourceSetData, fqName: String, analysis: Map<SourceSetData, EnvironmentAndFacade>): ContentNode { + val facade = analysis[platform]?.facade ?: + return this.also { context.logger.warn("Cannot resolve facade for platform ${platform.moduleName}")} val psiElement = fqNameToPsiElement(facade, fqName) ?: return this.also { context.logger.warn("Cannot find PsiElement corresponding to $fqName") } val imports = processImports(psiElement) // TODO: Process somehow imports. Maybe just attach them at the top of each body @@ -96,13 +95,13 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { return DescriptorToSourceUtils.descriptorToDeclaration(symbol) } - private fun contentCode(platforms: List<PlatformData>, dri: Set<DRI>, content: String, language: String) = + private fun contentCode(sourceSets: List<SourceSetData>, dri: Set<DRI>, content: String, language: String) = ContentCode( children = listOf( ContentText( text = content, dci = DCI(dri, ContentKind.BriefComment), - platforms = platforms.toSet(), + sourceSets = sourceSets.toSet(), style = emptySet(), extra = PropertyContainer.empty() ) @@ -110,7 +109,7 @@ abstract class SamplesTransformer(val context: DokkaContext) : PageTransformer { language = language, extra = PropertyContainer.empty(), dci = DCI(dri, ContentKind.Source), - platforms = platforms.toSet(), + sourceSets = sourceSets.toSet(), style = emptySet() ) }
\ No newline at end of file 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 fa73e757..876326d1 100644 --- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt @@ -5,9 +5,12 @@ import com.intellij.psi.PsiDocumentManager import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.model.DescriptorDocumentableSource +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.DocumentableSource import org.jetbrains.dokka.model.PsiDocumentableSource import org.jetbrains.dokka.model.WithExpectActual +import org.jetbrains.dokka.model.properties.PropertyContainer +import org.jetbrains.dokka.model.sourceSet import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.pages.PageTransformer @@ -30,11 +33,11 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent } private fun getSourceLinks() = context.configuration.passesConfigurations - .flatMap { it.sourceLinks.map { sl -> SourceLink(sl, it.platformData) } } + .flatMap { it.sourceLinks.map { sl -> SourceLink(sl, context.sourceSetCache.getSourceSet(it)) } } private fun resolveSources(documentable: WithExpectActual) = documentable.sources .mapNotNull { entry -> - getSourceLinks().find { entry.value.path.contains(it.path) && it.platformData == entry.key }?.let { + getSourceLinks().find { entry.value.path.contains(it.path) && it.sourceSetData == entry.key }?.let { Pair( entry.key, entry.value.toLink(it) @@ -42,7 +45,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent } } - private fun ContentPage.addSourcesContent(sources: List<Pair<PlatformData, String>>) = builder + private fun ContentPage.addSourcesContent(sources: List<Pair<SourceSetData, String>>) = builder .buildSourcesContent(this, sources) .let { this.modified( @@ -52,10 +55,10 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent private fun PageContentBuilder.buildSourcesContent( node: ContentPage, - sources: List<Pair<PlatformData, String>> + sources: List<Pair<SourceSetData, String>> ) = contentFor( node.dri.first(), - node.documentable!!.platformData.toSet() + node.documentable!!.sourceSets.toSet() ) { header(2) { text("Sources") } +ContentTable( @@ -66,7 +69,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent } }, DCI(node.dri, ContentKind.Source), - node.documentable!!.platformData.toSet(), + node.documentable!!.sourceSets.toSet(), style = emptySet() ) } @@ -94,7 +97,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent else -> ContentGroup( children = listOf(this, table), extra = this.extra, - platforms = this.platforms, + sourceSets = this.sourceSets, dci = this.dci, style = this.style ) @@ -107,8 +110,8 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent } } -data class SourceLink(val path: String, val url: String, val lineSuffix: String?, val platformData: PlatformData) { - constructor(sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, platformData: PlatformData) : this( - sourceLinkDefinition.path, sourceLinkDefinition.url, sourceLinkDefinition.lineSuffix, platformData +data class SourceLink(val path: String, val url: String, val lineSuffix: String?, val sourceSetData: SourceSetData) { + constructor(sourceLinkDefinition: DokkaConfiguration.SourceLinkDefinition, sourceSetData: SourceSetData) : this( + sourceLinkDefinition.path, sourceLinkDefinition.url, sourceLinkDefinition.lineSuffix, sourceSetData ) }
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 128b9bd4..7cc96a24 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -7,7 +7,6 @@ import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.properties.PropertyContainer -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.parsers.MarkdownParser import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.utilities.DokkaLogger @@ -20,6 +19,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies import org.jetbrains.kotlin.idea.kdoc.findKDoc +import org.jetbrains.kotlin.load.kotlin.toSourceElement import org.jetbrains.kotlin.psi.KtExpression import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.resolve.calls.components.isVararg @@ -37,35 +37,35 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs object DefaultDescriptorToDocumentableTranslator : SourceToDocumentableTranslator { - override fun invoke(platformData: PlatformData, context: DokkaContext): DModule { + override fun invoke(sourceSet: SourceSetData, context: DokkaContext): DModule { - val (environment, facade) = context.platforms.getValue(platformData) + val (environment, facade) = context.platforms.getValue(sourceSet) val packageFragments = environment.getSourceFiles().asSequence() .map { it.packageFqName } .distinct() .mapNotNull { facade.resolveSession.getPackageFragment(it) } .toList() - return DokkaDescriptorVisitor(platformData, context.platforms.getValue(platformData).facade, context.logger).run { + return DokkaDescriptorVisitor(sourceSet, context.platforms.getValue(sourceSet).facade, context.logger).run { packageFragments.mapNotNull { it.safeAs<PackageFragmentDescriptor>() }.map { visitPackageFragmentDescriptor( it, - DRIWithPlatformInfo(DRI.topLevel, PlatformDependent.empty()) + DRIWithPlatformInfo(DRI.topLevel, emptyMap()) ) } - }.let { DModule(platformData.name, it, PlatformDependent.empty(), listOf(platformData)) } + }.let { DModule(sourceSet.moduleName, it, emptyMap(), null, listOf(sourceSet)) } } } data class DRIWithPlatformInfo( val dri: DRI, - val actual: PlatformDependent<DocumentableSource> + val actual: SourceSetDependent<DocumentableSource> ) -fun DRI.withEmptyInfo() = DRIWithPlatformInfo(this, PlatformDependent.empty()) +fun DRI.withEmptyInfo() = DRIWithPlatformInfo(this, emptyMap()) private class DokkaDescriptorVisitor( - private val platformData: PlatformData, + private val sourceSet: SourceSetData, private val resolutionFacade: DokkaResolutionFacade, private val logger: DokkaLogger ) : DeclarationDescriptorVisitorEmptyBodies<Documentable, DRIWithPlatformInfo>() { @@ -73,23 +73,30 @@ private class DokkaDescriptorVisitor( throw IllegalStateException("${javaClass.simpleName} should never enter ${descriptor.javaClass.simpleName}") } + private fun Collection<DeclarationDescriptor>.filterDescriptorsInSourceSet() = filter { + val path = it.toSourceElement.containingFile.toString() + path.isNotBlank() && sourceSet.sourceRoots.any { root -> path.startsWith(root.path) } + } + + private fun <T> T.toSourceSetDependent() = mapOf(sourceSet to this) + override fun visitPackageFragmentDescriptor( descriptor: PackageFragmentDescriptor, parent: DRIWithPlatformInfo ): DPackage { - val name = descriptor.fqName.asString().takeUnless { it.isBlank() } - ?: "[" + platformData.targets.joinToString(" ") + " root]"// TODO: error-prone, find a better way to do it + val name = descriptor.fqName.asString().takeUnless { it.isBlank() } ?: + "[${sourceSet.sourceSetName} root]"// TODO: error-prone, find a better way to do it val driWithPlatform = DRI(packageName = name).withEmptyInfo() val scope = descriptor.getMemberScope() return DPackage( dri = driWithPlatform.dri, - functions = scope.functions(driWithPlatform), - properties = scope.properties(driWithPlatform), - classlikes = scope.classlikes(driWithPlatform), - typealiases = scope.typealiases(driWithPlatform), - documentation = descriptor.resolveDescriptorData(platformData), - platformData = listOf(platformData) + functions = scope.functions(driWithPlatform, true), + properties = scope.properties(driWithPlatform, true), + classlikes = scope.classlikes(driWithPlatform, true), + typealiases = scope.typealiases(driWithPlatform, true), + documentation = descriptor.resolveDescriptorData(), + sourceSets = listOf(sourceSet) ) } @@ -106,7 +113,7 @@ private class DokkaDescriptorVisitor( val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val isExpect = descriptor.isExpect - val info = descriptor.resolveClassDescriptionData(if (!isExpect) platformData else null) + val info = descriptor.resolveClassDescriptionData() return DInterface( @@ -116,14 +123,13 @@ private class DokkaDescriptorVisitor( properties = scope.properties(driWithPlatform), classlikes = scope.classlikes(driWithPlatform), sources = descriptor.createSources(), - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - supertypes = if (isExpect) PlatformDependent.expectFrom(info.supertypes) - else PlatformDependent.from(platformData, info.supertypes), + expectPresentInSet = sourceSet.takeIf { isExpect }, + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + supertypes = info.supertypes.toSourceSetDependent(), documentation = info.docs, generics = descriptor.typeConstructor.parameters.map { it.toTypeParameter() }, companion = descriptor.companion(driWithPlatform), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -132,7 +138,7 @@ private class DokkaDescriptorVisitor( val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val isExpect = descriptor.isExpect - val info = descriptor.resolveClassDescriptionData(if (!isExpect) platformData else null) + val info = descriptor.resolveClassDescriptionData() return DObject( @@ -142,12 +148,11 @@ private class DokkaDescriptorVisitor( properties = scope.properties(driWithPlatform), classlikes = scope.classlikes(driWithPlatform), sources = descriptor.createSources(), - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - supertypes = if (isExpect) PlatformDependent.expectFrom(info.supertypes) - else PlatformDependent.from(platformData, info.supertypes), + expectPresentInSet = sourceSet.takeIf { isExpect }, + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + supertypes = info.supertypes.toSourceSetDependent(), documentation = info.docs, - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -156,7 +161,7 @@ private class DokkaDescriptorVisitor( val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val isExpect = descriptor.isExpect - val info = descriptor.resolveClassDescriptionData(if (!isExpect) platformData else null) + val info = descriptor.resolveClassDescriptionData() return DEnum( dri = driWithPlatform.dri, @@ -167,13 +172,12 @@ private class DokkaDescriptorVisitor( properties = scope.properties(driWithPlatform), classlikes = scope.classlikes(driWithPlatform), sources = descriptor.createSources(), - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - supertypes = if (isExpect) PlatformDependent.expectFrom(info.supertypes) - else PlatformDependent.from(platformData, info.supertypes), + expectPresentInSet = sourceSet.takeIf { isExpect }, + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + supertypes = info.supertypes.toSourceSetDependent(), documentation = info.docs, companion = descriptor.companion(driWithPlatform), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -186,11 +190,12 @@ private class DokkaDescriptorVisitor( return DEnumEntry( dri = driWithPlatform.dri, name = descriptor.name.asString(), - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null), + documentation = descriptor.resolveDescriptorData(), classlikes = scope.classlikes(driWithPlatform), functions = scope.functions(driWithPlatform), properties = scope.properties(driWithPlatform), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), + expectPresentInSet = sourceSet.takeIf { isExpect }, extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -202,14 +207,15 @@ private class DokkaDescriptorVisitor( return DAnnotation( dri = driWithPlatform.dri, name = descriptor.name.asString(), - documentation = descriptor.resolveDescriptorData(platformData), + documentation = descriptor.resolveDescriptorData(), classlikes = scope.classlikes(driWithPlatform), functions = scope.functions(driWithPlatform), properties = scope.properties(driWithPlatform), - platformData = listOf(platformData), + expectPresentInSet = null, + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()), companion = descriptor.companionObjectDescriptor?.let { objectDescriptor(it, driWithPlatform) }, - visibility = PlatformDependent(mapOf(platformData to descriptor.visibility.toDokkaVisibility())), + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), constructors = descriptor.constructors.map { visitConstructorDescriptor(it, driWithPlatform) }, sources = descriptor.createSources() ) @@ -219,7 +225,7 @@ private class DokkaDescriptorVisitor( val driWithPlatform = parent.dri.withClass(descriptor.name.asString()).withEmptyInfo() val scope = descriptor.unsubstitutedMemberScope val isExpect = descriptor.isExpect - val info = descriptor.resolveClassDescriptionData(if (!isExpect) platformData else null) + val info = descriptor.resolveClassDescriptionData() val actual = descriptor.createSources() return DClass( @@ -229,23 +235,21 @@ private class DokkaDescriptorVisitor( visitConstructorDescriptor( it, if (it.isPrimary) DRIWithPlatformInfo(driWithPlatform.dri, actual) - else DRIWithPlatformInfo(driWithPlatform.dri, PlatformDependent.empty()) + else DRIWithPlatformInfo(driWithPlatform.dri, emptyMap()) ) }, functions = scope.functions(driWithPlatform), properties = scope.properties(driWithPlatform), classlikes = scope.classlikes(driWithPlatform), sources = actual, - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - supertypes = if (isExpect) PlatformDependent.expectFrom(info.supertypes) - else PlatformDependent.from(platformData, info.supertypes), + expectPresentInSet = sourceSet.takeIf { isExpect }, + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + supertypes = info.supertypes.toSourceSetDependent(), generics = descriptor.typeConstructor.parameters.map { it.toTypeParameter() }, documentation = info.docs, - modifier = if (isExpect) PlatformDependent.expectFrom(descriptor.modifier()) - else PlatformDependent.from(platformData, descriptor.modifier()), + modifier = descriptor.modifier().toSourceSetDependent(), companion = descriptor.companion(driWithPlatform), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -268,13 +272,12 @@ private class DokkaDescriptorVisitor( setter = descriptor.accessors.filterIsInstance<PropertySetterDescriptor>().singleOrNull()?.let { visitPropertyAccessorDescriptor(it, descriptor, dri) }, - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null), - modifier = if (isExpect) PlatformDependent.expectFrom(descriptor.modifier()) - else PlatformDependent.from(platformData, descriptor.modifier()), + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + documentation = descriptor.resolveDescriptorData(), + modifier = descriptor.modifier().toSourceSetDependent(), type = descriptor.returnType!!.toBound(), - platformData = listOf(platformData), + expectPresentInSet = sourceSet.takeIf { isExpect }, + sourceSets = listOf(sourceSet), generics = descriptor.typeParameters.map { it.toTypeParameter() }, extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) @@ -301,15 +304,14 @@ private class DokkaDescriptorVisitor( parameters = descriptor.valueParameters.mapIndexed { index, desc -> parameter(index, desc, DRIWithPlatformInfo(dri, actual)) }, + expectPresentInSet = sourceSet.takeIf { isExpect }, sources = actual, - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), generics = descriptor.typeParameters.map { it.toTypeParameter() }, - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null), - modifier = if (isExpect) PlatformDependent.expectFrom(descriptor.modifier()) - else PlatformDependent.from(platformData, descriptor.modifier()), + documentation = descriptor.resolveDescriptorData(), + modifier = descriptor.modifier().toSourceSetDependent(), type = descriptor.returnType!!.toBound(), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll( InheritedFunction(isInherited), descriptor.additionalExtras(), descriptor.getAnnotations() @@ -333,41 +335,27 @@ private class DokkaDescriptorVisitor( parameter(index, desc, DRIWithPlatformInfo(dri, actual)) }, sources = actual, - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null).let { + expectPresentInSet = sourceSet.takeIf { isExpect }, + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + documentation = descriptor.resolveDescriptorData().let { sourceSetDependent -> if (descriptor.isPrimary) { - it.copy( - map = PlatformDependent.from(it.map.map { - Pair( - it.key, - it.value.copy(children = (it.value.children.find { it is Constructor }?.root?.let { constructor -> - listOf( - Description(constructor) - ) - } ?: emptyList<TagWrapper>()) + it.value.children.filterIsInstance<Param>()) - ) - }), - expect = it.expect?.copy(children = (it.expect?.children?.find { it is Constructor }?.root?.let { constructor -> - listOf( - Description(constructor) - ) - } ?: emptyList<TagWrapper>()) + it.expect!!.children.filterIsInstance<Param>()) - ) + sourceSetDependent.map { entry -> + Pair(entry.key, entry.value.copy(children = (entry.value.children.find { it is Constructor }?.root?.let { constructor -> + listOf( Description(constructor) ) + } ?: emptyList<TagWrapper>()) + entry.value.children.filterIsInstance<Param>())) + }.toMap() } else { - it + sourceSetDependent } }, type = descriptor.returnType.toBound(), - modifier = if (isExpect) PlatformDependent.expectFrom(descriptor.modifier()) - else PlatformDependent.from(platformData, descriptor.modifier()), + modifier = descriptor.modifier().toSourceSetDependent(), generics = descriptor.typeParameters.map { it.toTypeParameter() }, - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll<DFunction>(descriptor.additionalExtras(), descriptor.getAnnotations()) .let { - if (descriptor.isPrimary) { - it + PrimaryConstructorExtra - } else it + if(descriptor.isPrimary) { it + PrimaryConstructorExtra } + else it } ) } @@ -379,8 +367,9 @@ private class DokkaDescriptorVisitor( dri = parent.dri.copy(target = 0), name = null, type = descriptor.type.toBound(), - documentation = descriptor.resolveDescriptorData(platformData), - platformData = listOf(platformData) + expectPresentInSet = null, + documentation = descriptor.resolveDescriptorData(), + sourceSets = listOf(sourceSet) ) private fun visitPropertyAccessorDescriptor( @@ -397,8 +386,9 @@ private class DokkaDescriptorVisitor( parent.copy(target = 1), this.name.asString(), type = this.type.toBound(), - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null), - platformData = listOf(platformData), + expectPresentInSet = sourceSet.takeIf { isExpect }, + documentation = descriptor.resolveDescriptorData(), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) @@ -420,13 +410,12 @@ private class DokkaDescriptorVisitor( name, isConstructor = false, parameters = parameters, - visibility = if (isExpect) PlatformDependent.expectFrom(descriptor.visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, descriptor.visibility.toDokkaVisibility()), - documentation = descriptor.resolveDescriptorData(if (!isExpect) platformData else null), + visibility = descriptor.visibility.toDokkaVisibility().toSourceSetDependent(), + documentation = descriptor.resolveDescriptorData(), type = descriptor.returnType!!.toBound(), generics = descriptor.typeParameters.map { it.toTypeParameter() }, - modifier = if (isExpect) PlatformDependent.expectFrom(descriptor.modifier()) - else PlatformDependent.from(platformData, descriptor.modifier()), + modifier = descriptor.modifier().toSourceSetDependent(), + expectPresentInSet = sourceSet.takeIf { isExpect }, receiver = descriptor.extensionReceiverParameter?.let { visitReceiverParameterDescriptor( it, @@ -434,7 +423,7 @@ private class DokkaDescriptorVisitor( ) }, sources = descriptor.createSources(), - platformData = listOf(platformData), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll(descriptor.additionalExtras(), descriptor.getAnnotations()) ) } @@ -445,11 +434,11 @@ private class DokkaDescriptorVisitor( dri = DRI.from(this), name = name.asString(), type = defaultType.toBound(), - underlyingType = PlatformDependent.from(platformData, underlyingType.toBound()), - visibility = if (isExpect) PlatformDependent.expectFrom(visibility.toDokkaVisibility()) - else PlatformDependent.from(platformData, visibility.toDokkaVisibility()), - documentation = resolveDescriptorData(platformData), - platformData = listOf(platformData) + expectPresentInSet = null, + underlyingType = underlyingType.toBound().toSourceSetDependent(), + visibility = visibility.toDokkaVisibility().toSourceSetDependent(), + documentation = resolveDescriptorData(), + sourceSets = listOf(sourceSet) ) } @@ -458,8 +447,9 @@ private class DokkaDescriptorVisitor( dri = parent.dri.copy(target = index + 1), name = descriptor.name.asString(), type = descriptor.type.toBound(), - documentation = descriptor.resolveDescriptorData(platformData), - platformData = listOf(platformData), + expectPresentInSet = null, + documentation = descriptor.resolveDescriptorData(), + sourceSets = listOf(sourceSet), extra = PropertyContainer.withAll( listOfNotNull( descriptor.additionalExtras(), @@ -468,18 +458,23 @@ private class DokkaDescriptorVisitor( ) ) - private fun MemberScope.functions(parent: DRIWithPlatformInfo): List<DFunction> = - getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) { true } + private fun MemberScope.getContributedDescriptors(kindFilter: DescriptorKindFilter, shouldFilter: Boolean) = + getContributedDescriptors(kindFilter) { true }.let { + if (shouldFilter) it.filterDescriptorsInSourceSet() else it + } + + private fun MemberScope.functions(parent: DRIWithPlatformInfo, packageLevel: Boolean = false): List<DFunction> = + getContributedDescriptors(DescriptorKindFilter.FUNCTIONS, packageLevel) .filterIsInstance<FunctionDescriptor>() .map { visitFunctionDescriptor(it, parent) } - private fun MemberScope.properties(parent: DRIWithPlatformInfo): List<DProperty> = - getContributedDescriptors(DescriptorKindFilter.VALUES) { true } + private fun MemberScope.properties(parent: DRIWithPlatformInfo, packageLevel: Boolean = false): List<DProperty> = + getContributedDescriptors(DescriptorKindFilter.VALUES, packageLevel) .filterIsInstance<PropertyDescriptor>() .map { visitPropertyDescriptor(it, parent) } - private fun MemberScope.classlikes(parent: DRIWithPlatformInfo): List<DClasslike> = - getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS) { true } + private fun MemberScope.classlikes(parent: DRIWithPlatformInfo, packageLevel: Boolean = false): List<DClasslike> = + getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, packageLevel) .filter { it is ClassDescriptor && it.kind != ClassKind.ENUM_ENTRY } .map { visitClassDescriptor(it as ClassDescriptor, parent) } .mapNotNull { it as? DClasslike } @@ -489,8 +484,8 @@ private class DokkaDescriptorVisitor( .filterIsInstance<PackageFragmentDescriptor>() .map { visitPackageFragmentDescriptor(it, parent) } - private fun MemberScope.typealiases(parent: DRIWithPlatformInfo): List<DTypeAlias> = - getContributedDescriptors(DescriptorKindFilter.TYPE_ALIASES) { true } + private fun MemberScope.typealiases(parent: DRIWithPlatformInfo, packageLevel: Boolean = false): List<DTypeAlias> = + getContributedDescriptors(DescriptorKindFilter.TYPE_ALIASES, packageLevel) .filterIsInstance<TypeAliasDescriptor>() .map { visitTypeAliasDescriptor(it, parent) } @@ -500,19 +495,14 @@ private class DokkaDescriptorVisitor( .filter { it.kind == ClassKind.ENUM_ENTRY } .map { enumEntryDescriptor(it, parent) } - private fun DeclarationDescriptor.resolveDescriptorData(platformData: PlatformData?): PlatformDependent<DocumentationNode> = getDocumentation().let { - if (it.children.isEmpty()) - PlatformDependent.empty() - else if (platformData != null) - PlatformDependent.from(platformData, it) - else - PlatformDependent.expectFrom(it) - } - private fun ClassDescriptor.resolveClassDescriptionData(platformData: PlatformData?): ClassInfo { + private fun DeclarationDescriptor.resolveDescriptorData(): SourceSetDependent<DocumentationNode> = + getDocumentation()?.toSourceSetDependent() ?: emptyMap() + + private fun ClassDescriptor.resolveClassDescriptionData(): ClassInfo { return ClassInfo( (getSuperInterfaces() + getAllSuperclassesWithoutAny()).map { DRI.from(it) }, - resolveDescriptorData(platformData) + resolveDescriptorData() ) } @@ -520,9 +510,10 @@ private class DokkaDescriptorVisitor( DTypeParameter( DRI.from(this), name.identifier, - PlatformDependent.from(platformData, getDocumentation()), + resolveDescriptorData(), + null, upperBounds.map { it.toBound() }, - listOf(platformData), + listOf(sourceSet), extra = PropertyContainer.withAll(additionalExtras()) ) @@ -555,7 +546,7 @@ private class DokkaDescriptorVisitor( private fun DeclarationDescriptor.getDocumentation() = findKDoc().let { MarkdownParser(resolutionFacade, this, logger).parseFromKDocTag(it) - } + }.takeIf { it.children.isNotEmpty() } private fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): DObject? = companionObjectDescriptor?.let { objectDescriptor(it, dri) @@ -569,11 +560,8 @@ private class DokkaDescriptorVisitor( else -> KotlinModifier.Empty } - private fun MemberDescriptor.createSources(): PlatformDependent<DocumentableSource> = if (isExpect()) { - PlatformDependent(emptyMap(), DescriptorDocumentableSource(this)) - } else { - PlatformDependent(mapOf(platformData to DescriptorDocumentableSource(this))) - } + private fun MemberDescriptor.createSources(): SourceSetDependent<DocumentableSource> = + DescriptorDocumentableSource(this).toSourceSetDependent() private fun FunctionDescriptor.additionalExtras() = listOfNotNull( ExtraModifiers.DYNAMIC.takeIf { isDynamic() }, @@ -634,7 +622,7 @@ private class DokkaDescriptorVisitor( private fun ValueParameterDescriptor.getDefaultValue(): String? = (source as? KotlinSourceElement)?.psi?.children?.find { it is KtExpression }?.text - private data class ClassInfo(val supertypes: List<DRI>, val docs: PlatformDependent<DocumentationNode>) + private data class ClassInfo(val supertypes: List<DRI>, val docs: SourceSetDependent<DocumentationNode>) private fun Visibility.toDokkaVisibility(): org.jetbrains.dokka.model.Visibility = when (this) { Visibilities.PUBLIC -> KotlinVisibility.Public diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 439da560..232f6721 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -14,7 +14,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs import kotlin.reflect.KClass import kotlin.reflect.full.isSubclassOf -private typealias GroupedTags = Map<KClass<out TagWrapper>, List<Pair<PlatformData?, TagWrapper>>> +private typealias GroupedTags = Map<KClass<out TagWrapper>, List<Pair<SourceSetData?, TagWrapper>>> private val specialTags: Set<KClass<out TagWrapper>> = setOf(Property::class, Description::class, Constructor::class, Receiver::class, Param::class, See::class) @@ -68,8 +68,8 @@ open class DefaultPageCreator( header(1) { text(m.name) } } +contentForComments(m) - block("Packages", 2, ContentKind.Packages, m.packages, m.platformData.toSet()) { - link(it.name, it.dri, kind = ContentKind.Main) + block("Packages", 2, ContentKind.Packages, m.packages, m.sourceSets.toSet()) { + link(it.name, it.dri) } // text("Index\n") TODO // text("Link to allpage here") @@ -80,10 +80,10 @@ open class DefaultPageCreator( header(1) { text("Package ${p.name}") } } +contentForComments(p) - +contentForScope(p, p.dri, p.platformData) - block("Type aliases", 2, ContentKind.TypeAliases, p.typealiases, p.platformData.toSet()) { + +contentForScope(p, p.dri, p.sourceSets) + block("Type aliases", 2, ContentKind.TypeAliases, p.typealiases, p.sourceSets.toSet()) { link(it.name, it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } @@ -93,47 +93,47 @@ open class DefaultPageCreator( protected open fun contentForScope( s: WithScope, dri: DRI, - platformData: List<PlatformData> + sourceSets: List<SourceSetData> ) = contentBuilder.contentFor(s as Documentable) { - block("Types", 2, ContentKind.Classlikes, s.classlikes, platformData.toSet()) { + block("Types", 2, ContentKind.Classlikes, s.classlikes, sourceSets.toSet()) { link(it.name ?: "", it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } } - block("Functions", 2, ContentKind.Functions, s.functions, platformData.toSet()) { + block("Functions", 2, ContentKind.Functions, s.functions, sourceSets.toSet()) { link(it.name, it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } } - block("Properties", 2, ContentKind.Properties, s.properties, platformData.toSet()) { + block("Properties", 2, ContentKind.Properties, s.properties, sourceSets.toSet()) { link(it.name, it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } } s.safeAs<WithExtraProperties<Documentable>>()?.let { it.extra[InheritorsInfo] }?.let { inheritors -> - val map = inheritors.value.map.filter { it.value.isNotEmpty() } + val map = inheritors.value.filter { it.value.isNotEmpty() } if (map.values.any()) { header(2) { text("Inheritors") } +ContentTable( emptyList(), map.entries.flatMap { entry -> entry.value.map { Pair(entry.key, it) } } .groupBy({ it.second }, { it.first }).map { (classlike, platforms) -> - buildGroup(dri, platforms.toSet(), ContentKind.Inheritors) { - link( - classlike.classNames?.substringBeforeLast(".") ?: classlike.toString() - .also { logger.warn("No class name found for DRI $classlike") }, classlike - ) - } - }, + buildGroup(dri, platforms.toSet(), ContentKind.Inheritors) { + link( + classlike.classNames?.substringBeforeLast(".") ?: classlike.toString() + .also { logger.warn("No class name found for DRI $classlike") }, classlike + ) + } + }, DCI(setOf(dri), ContentKind.Inheritors), - platformData.toSet(), + sourceSets.toSet(), style = emptySet() ) } @@ -146,13 +146,13 @@ open class DefaultPageCreator( +buildSignature(e) } +contentForComments(e) - +contentForScope(e, e.dri, e.platformData) + +contentForScope(e, e.dri, e.sourceSets) } protected open fun contentForClasslike(c: DClasslike) = contentBuilder.contentFor(c) { group(kind = ContentKind.Cover) { header(1) { text(c.name.orEmpty()) } - platformDependentHint(c.dri, c.platformData.toSet()) { + sourceSetDependentHint(c.dri, c.sourceSets.toSet()) { +buildSignature(c) } } @@ -164,58 +164,57 @@ open class DefaultPageCreator( 2, ContentKind.Constructors, c.constructors.filter { it.extra[PrimaryConstructorExtra] == null }, - c.platformData.toSet() + c.sourceSets.toSet() ) { link(it.name, it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } } } if (c is DEnum) { - block("Entries", 2, ContentKind.Classlikes, c.entries, c.platformData.toSet()) { + block("Entries", 2, ContentKind.Classlikes, c.entries, c.sourceSets.toSet()) { link(it.name, it.dri, kind = ContentKind.Main) - platformDependentHint(it.dri, it.platformData.toSet(), kind = ContentKind.PlatformDependantHint) { + sourceSetDependentHint(it.dri, it.sourceSets.toSet(), kind = ContentKind.SourceSetDependantHint) { +buildSignature(it) contentForBrief(it) } } } - +contentForScope(c, c.dri, c.platformData) + +contentForScope(c, c.dri, c.sourceSets) } @Suppress("UNCHECKED_CAST") - private inline fun <reified T : TagWrapper> GroupedTags.withTypeUnnamed(): PlatformDependent<T> = - (this[T::class] as List<Pair<PlatformData, T>>?) - ?.let { PlatformDependent.from(it) }.orEmpty() + private inline fun <reified T : TagWrapper> GroupedTags.withTypeUnnamed(): SourceSetDependent<T> = + (this[T::class] as List<Pair<SourceSetData, T>>?)?.toMap().orEmpty() @Suppress("UNCHECKED_CAST") - private inline fun <reified T : NamedTagWrapper> GroupedTags.withTypeNamed(): Map<String, PlatformDependent<T>> = - (this[T::class] as List<Pair<PlatformData, T>>?) + private inline fun <reified T : NamedTagWrapper> GroupedTags.withTypeNamed(): Map<String, SourceSetDependent<T>> = + (this[T::class] as List<Pair<SourceSetData, T>>?) ?.groupBy { it.second.name } - ?.mapValues { (_, v) -> PlatformDependent.from(v) } + ?.mapValues { (_, v) -> v.toMap() } .orEmpty() private inline fun <reified T : TagWrapper> GroupedTags.isNotEmptyForTag(): Boolean = - this[T::class]?.isNotEmpty() ?: false + this[T::class]?.isNotEmpty() ?: false protected open fun contentForComments( d: Documentable ): List<ContentNode> { - val tags: GroupedTags = d.documentation.allEntries.flatMap { (pd, doc) -> - doc.children.asSequence().map { pd to it } + val tags: GroupedTags = d.documentation.flatMap { (pd, doc) -> + doc.children.asSequence().map { pd to it }.toList() }.groupBy { it.second::class } - val platforms = d.platformData + val platforms = d.sourceSets fun DocumentableContentBuilder.contentForDescription() { val description = tags.withTypeUnnamed<Description>() if (description.any { it.value.root.children.isNotEmpty() }) { platforms.forEach { platform -> - description.getOrExpect(platform)?.also { - group(platformData = setOf(platform)) { + description[platform]?.also { + group(sourceSets = setOf(platform)) { comment(it.root) } } @@ -232,16 +231,16 @@ open class DefaultPageCreator( } table(kind = ContentKind.Parameters) { platforms.flatMap { platform -> - val receiverRow = receiver.getOrExpect(platform)?.let { - buildGroup(platformData = setOf(platform), kind = ContentKind.Parameters, styles = mainStyles + ContentStyle.KeyValue) { + val receiverRow = receiver[platform]?.let { + buildGroup(sourceSets = setOf(platform), kind = ContentKind.Parameters, styles = mainStyles + ContentStyle.KeyValue) { text("<receiver>") comment(it.root) } } val paramRows = params.mapNotNull { (_, param) -> - param.getOrExpect(platform)?.let { - buildGroup(platformData = setOf(platform), kind = ContentKind.Parameters, styles = mainStyles + ContentStyle.KeyValue) { + param[platform]?.let { + buildGroup(sourceSets = setOf(platform), kind = ContentKind.Parameters, styles = mainStyles + ContentStyle.KeyValue) { text(it.name, kind = ContentKind.Parameters) comment(it.root) } @@ -263,8 +262,8 @@ open class DefaultPageCreator( table(kind = ContentKind.Sample) { platforms.flatMap { platform -> seeAlsoTags.mapNotNull { (_, see) -> - see.getOrExpect(platform)?.let { - buildGroup(platformData = setOf(platform), kind = ContentKind.Comment, styles = mainStyles + ContentStyle.KeyValue) { + see[platform]?.let { + buildGroup(sourceSets = setOf(platform), kind = ContentKind.Comment, styles = mainStyles + ContentStyle.KeyValue) { if (it.address != null) link(it.name, it.address!!, kind = ContentKind.Comment) else text(it.name, kind = ContentKind.Comment) comment(it.root) @@ -282,7 +281,7 @@ open class DefaultPageCreator( platforms.forEach { platformData -> val content = samples.filter { it.value.isEmpty() || platformData in it.value } if (content.isNotEmpty()) { - group(platformData = setOf(platformData)) { + group(sourceSets = setOf(platformData)) { header(4, kind = ContentKind.Comment) { text("Samples") } content.forEach { comment(Text(it.key)) @@ -294,13 +293,13 @@ open class DefaultPageCreator( } fun DocumentableContentBuilder.contentForUnnamedTags() { - val unnamedTags: List<PlatformDependent<TagWrapper>> = + val unnamedTags: List<SourceSetDependent<TagWrapper>> = tags.filterNot { (k, _) -> k.isSubclassOf(NamedTagWrapper::class) || k in specialTags } - .map { (_, v) -> PlatformDependent.from(v) } + .map { (_, v) -> v.mapNotNull { (k,v) -> k?.let { it to v } }.toMap() } platforms.forEach { platform -> unnamedTags.forEach { pdTag -> - pdTag.getOrExpect(platform)?.also { tag -> - group(platformData = setOf(platform)) { + pdTag[platform]?.also { tag -> + group(sourceSets = setOf(platform)) { header(4) { text(tag.toHeaderString()) } comment(tag.root) } @@ -312,7 +311,7 @@ open class DefaultPageCreator( return contentBuilder.contentFor(d) { if (tags.isNotEmpty()) { header(3) { text("Description") } - platformDependentHint(platformData = platforms.toSet()) { + sourceSetDependentHint(sourceSets = platforms.toSet()) { contentForDescription() contentForSamples() contentForParams() @@ -324,11 +323,11 @@ open class DefaultPageCreator( } protected open fun DocumentableContentBuilder.contentForBrief(content: Documentable) { - content.platformData.forEach { platform -> + content.sourceSets.forEach { platform -> val root = content.documentation[platform]?.children?.firstOrNull()?.root root?.let { - group(platformData = setOf(platform), kind = ContentKind.BriefComment) { + group(sourceSets = setOf(platform), kind = ContentKind.BriefComment) { text(it.docTagSummary(), kind = ContentKind.Comment) } } @@ -338,7 +337,7 @@ open class DefaultPageCreator( protected open fun contentForFunction(f: DFunction) = contentBuilder.contentFor(f) { group(kind = ContentKind.Cover) { header(1) { text(f.name) } - platformDependentHint(f.dri, f.platformData.toSet()) { + sourceSetDependentHint(f.dri, f.sourceSets.toSet()) { +buildSignature(f) } } diff --git a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt index 6cb47b7f..3ed19afa 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/PageContentBuilder.kt @@ -19,46 +19,46 @@ open class PageContentBuilder( ) { fun contentFor( dri: DRI, - platformData: Set<PlatformData>, + sourceSets: Set<SourceSetData>, kind: Kind = ContentKind.Main, styles: Set<Style> = emptySet(), extra: PropertyContainer<ContentNode> = PropertyContainer.empty(), block: DocumentableContentBuilder.() -> Unit ): ContentGroup = - DocumentableContentBuilder(dri, platformData, styles, extra) + DocumentableContentBuilder(dri, sourceSets, styles, extra) .apply(block) - .build(platformData, kind, styles, extra) + .build(sourceSets, kind, styles, extra) fun contentFor( d: Documentable, kind: Kind = ContentKind.Main, styles: Set<Style> = emptySet(), extra: PropertyContainer<ContentNode> = PropertyContainer.empty(), - platformData: Set<PlatformData> = d.platformData.toSet(), + sourceSets: Set<SourceSetData> = d.sourceSets.toSet(), block: DocumentableContentBuilder.() -> Unit = {} ): ContentGroup = - DocumentableContentBuilder(d.dri, platformData, styles, extra) + DocumentableContentBuilder(d.dri, sourceSets, styles, extra) .apply(block) - .build(platformData, kind, styles, extra) + .build(sourceSets, kind, styles, extra) @ContentBuilderMarker open inner class DocumentableContentBuilder( val mainDRI: DRI, - val mainPlatformData: Set<PlatformData>, + val mainPlatformData: Set<SourceSetData>, val mainStyles: Set<Style>, val mainExtra: PropertyContainer<ContentNode> ) { protected val contents = mutableListOf<ContentNode>() fun build( - platformData: Set<PlatformData>, + sourceSets: Set<SourceSetData>, kind: Kind, styles: Set<Style>, extra: PropertyContainer<ContentNode> ) = ContentGroup( contents.toList(), DCI(setOf(mainDRI), kind), - platformData, + sourceSets, styles, extra ) @@ -74,7 +74,7 @@ open class PageContentBuilder( fun header( level: Int, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + platformData: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, block: DocumentableContentBuilder.() -> Unit @@ -88,11 +88,11 @@ open class PageContentBuilder( fun text( text: String, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ) { - contents += createText(text, kind, platformData, styles, extra) + contents += createText(text, kind, sourceSets, styles, extra) } fun buildSignature(d: Documentable) = signatureProvider.signature(d) @@ -100,26 +100,26 @@ open class PageContentBuilder( fun linkTable( elements: List<DRI>, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ) { contents += ContentTable( emptyList(), elements.map { - contentFor(it, platformData, kind, styles, extra) { + contentFor(it, sourceSets, kind, styles, extra) { link(it.classNames ?: "", it) } }, DCI(setOf(mainDRI), kind), - platformData, styles, extra + sourceSets, styles, extra ) } fun table( dri: DRI = mainDRI, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, operation: DocumentableContentBuilder.() -> List<ContentGroup> @@ -128,7 +128,7 @@ open class PageContentBuilder( emptyList(), operation(), DCI(setOf(mainDRI), kind), - platformData, styles, extra + sourceSets, styles, extra ) } @@ -137,7 +137,7 @@ open class PageContentBuilder( level: Int, kind: Kind = ContentKind.Main, elements: Iterable<T>, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, renderWhenEmpty: Boolean = false, @@ -148,12 +148,12 @@ open class PageContentBuilder( contents += ContentTable( emptyList(), elements.map { - buildGroup(it.dri, it.platformData.toSet(), kind, styles, extra) { + buildGroup(it.dri, it.sourceSets.toSet(), kind, styles, extra) { operation(it) } }, DCI(setOf(mainDRI), kind), - platformData, styles, extra + sourceSets, styles, extra ) } } @@ -163,17 +163,17 @@ open class PageContentBuilder( prefix: String = "", suffix: String = "", separator: String = ", ", - platformData: Set<PlatformData> = mainPlatformData, // TODO: children should be aware of this platform data + sourceSets: Set<SourceSetData> = mainPlatformData, // TODO: children should be aware of this platform data operation: DocumentableContentBuilder.(T) -> Unit ) { if (elements.isNotEmpty()) { - if (prefix.isNotEmpty()) text(prefix, platformData = platformData) + if (prefix.isNotEmpty()) text(prefix, sourceSets = sourceSets) elements.dropLast(1).forEach { operation(it) - text(separator, platformData = platformData) + text(separator, sourceSets = sourceSets) } operation(elements.last()) - if (suffix.isNotEmpty()) text(suffix, platformData = platformData) + if (suffix.isNotEmpty()) text(suffix, sourceSets = sourceSets) } } @@ -181,15 +181,15 @@ open class PageContentBuilder( text: String, address: DRI, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ) { contents += ContentDRILink( - listOf(createText(text, kind, platformData, styles, extra)), + listOf(createText(text, kind, sourceSets, styles, extra)), address, DCI(setOf(mainDRI), kind), - platformData + sourceSets ) } @@ -197,99 +197,99 @@ open class PageContentBuilder( text: String, address: String, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ) = ContentResolvedLink( - children = listOf(createText(text, kind, platformData, styles, extra)), + children = listOf(createText(text, kind, sourceSets, styles, extra)), address = address, extra = PropertyContainer.empty(), dci = DCI(setOf(mainDRI), kind), - platforms = platformData, + sourceSets = sourceSets, style = emptySet() ) fun link( address: DRI, kind: Kind = ContentKind.Main, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, block: DocumentableContentBuilder.() -> Unit ) { contents += ContentDRILink( - contentFor(mainDRI, platformData, kind, styles, extra, block).children, + contentFor(mainDRI, sourceSets, kind, styles, extra, block).children, address, DCI(setOf(mainDRI), kind), - platformData + sourceSets ) } fun comment( docTag: DocTag, kind: Kind = ContentKind.Comment, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra ) { val content = commentsConverter.buildContent( docTag, DCI(setOf(mainDRI), kind), - platformData + sourceSets ) - contents += ContentGroup(content, DCI(setOf(mainDRI), kind), platformData, styles, extra) + contents += ContentGroup(content, DCI(setOf(mainDRI), kind), sourceSets, styles, extra) } fun group( dri: DRI = mainDRI, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, kind: Kind = ContentKind.Main, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, block: DocumentableContentBuilder.() -> Unit ) { - contents += buildGroup(dri, platformData, kind, styles, extra, block) + contents += buildGroup(dri, sourceSets, kind, styles, extra, block) } fun buildGroup( dri: DRI = mainDRI, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, kind: Kind = ContentKind.Main, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, block: DocumentableContentBuilder.() -> Unit - ): ContentGroup = contentFor(dri, platformData, kind, styles, extra, block) + ): ContentGroup = contentFor(dri, sourceSets, kind, styles, extra, block) - fun platformDependentHint( + fun sourceSetDependentHint( dri: DRI = mainDRI, - platformData: Set<PlatformData> = mainPlatformData, + sourceSets: Set<SourceSetData> = mainPlatformData, kind: Kind = ContentKind.Main, styles: Set<Style> = mainStyles, extra: PropertyContainer<ContentNode> = mainExtra, block: DocumentableContentBuilder.() -> Unit ) { contents += PlatformHintedContent( - buildGroup(dri, platformData, kind, styles, extra, block), - platformData + buildGroup(dri, sourceSets, kind, styles, extra, block), + sourceSets ) } protected fun createText( text: String, kind: Kind, - platformData: Set<PlatformData>, + sourceSets: Set<SourceSetData>, styles: Set<Style>, extra: PropertyContainer<ContentNode> ) = - ContentText(text, DCI(setOf(mainDRI), kind), platformData, styles, extra) + ContentText(text, DCI(setOf(mainDRI), kind), sourceSets, styles, extra) fun <T> platformText( - value: PlatformDependent<T>, - platforms: Set<PlatformData> = value.keys, + value: SourceSetDependent<T>, + platforms: Set<SourceSetData> = value.keys, transform: (T) -> String ) = value.entries.filter { it.key in platforms }.forEach { (p, v) -> - transform(v).takeIf { it.isNotBlank() }?.also { text(it, platformData = setOf(p)) } + transform(v).takeIf { it.isNotBlank() }?.also { text(it, sourceSets = setOf(p)) } } } }
\ No newline at end of file diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index e5fa4bfc..ca8055c8 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -9,7 +9,6 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.PropertyContainer -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.sources.SourceToDocumentableTranslator import org.jetbrains.dokka.utilities.DokkaLogger @@ -23,16 +22,21 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.psiUtil.getChildOfType import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.utils.addToStdlib.safeAs +import java.io.File object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { - override fun invoke(platformData: PlatformData, context: DokkaContext): DModule { + override fun invoke(sourceSetData: SourceSetData, context: DokkaContext): DModule { - val (environment, _) = context.platforms.getValue(platformData) + fun isFileInSourceRoots(file: File) : Boolean { + return sourceSetData.sourceRoots.any { root -> file.path.startsWith(File(root.path).absolutePath) } + } + + val (environment, _) = context.platforms.getValue(sourceSetData) val sourceRoots = environment.configuration.get(CLIConfigurationKeys.CONTENT_ROOTS) ?.filterIsInstance<JavaSourceRoot>() - ?.map { it.file } + ?.mapNotNull { it.file.takeIf(::isFileInSourceRoots) } ?: listOf() val localFileSystem = VirtualFileManager.getInstance().getFileSystem("file") @@ -46,11 +50,11 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { val docParser = DokkaPsiParser( - platformData, + sourceSetData, context.logger ) return DModule( - platformData.name, + sourceSetData.moduleName, psiFiles.mapNotNull { it.safeAs<PsiJavaFile>() }.groupBy { it.packageName }.map { (packageName, psiFiles) -> val dri = DRI(packageName = packageName) DPackage( @@ -61,17 +65,19 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { psiFile.classes.map { docParser.parseClasslike(it, dri) } }, emptyList(), - PlatformDependent.empty(), - listOf(platformData) + emptyMap(), + null, + listOf(sourceSetData) ) }, - PlatformDependent.empty(), - listOf(platformData) + emptyMap(), + null, + listOf(sourceSetData) ) } class DokkaPsiParser( - private val platformData: PlatformData, + private val sourceSetData: SourceSetData, private val logger: DokkaLogger ) { @@ -104,7 +110,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { } private fun <T> T.toPlatformDependant() = - PlatformDependent(mapOf(platformData to this)) + mapOf(sourceSetData to this) fun parseClasslike(psi: PsiClass, parent: DRI): DClasslike = with(psi) { val dri = parent.withClass(name.toString()) @@ -145,6 +151,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { name.orEmpty(), dri, documentation, + null, source, allFunctions, fields.mapNotNull { parseField(it, accessors[it].orEmpty()) }, @@ -152,7 +159,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { visibility, null, constructors.map { parseFunction(it, true) }, - listOf(platformData), + listOf(sourceSetData), PropertyContainer.empty<DAnnotation>() + annotations.toList().toExtra() ) isEnum -> DEnum( @@ -163,14 +170,16 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { dri.withClass("$name.${entry.name}"), entry.name.orEmpty(), javadocParser.parseDocumentation(entry).toPlatformDependant(), + null, emptyList(), emptyList(), emptyList(), - listOf(platformData), + listOf(sourceSetData), PropertyContainer.empty<DEnumEntry>() + entry.annotations.toList().toExtra() ) }, documentation, + null, source, allFunctions, fields.filter { it !is PsiEnumConstant }.map { parseField(it, accessors[it].orEmpty()) }, @@ -179,13 +188,14 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { null, constructors.map { parseFunction(it, true) }, ancestors, - listOf(platformData), + listOf(sourceSetData), PropertyContainer.empty<DEnum>() + annotations.toList().toExtra() ) isInterface -> DInterface( dri, name.orEmpty(), documentation, + null, source, allFunctions, fields.mapNotNull { parseField(it, accessors[it].orEmpty()) }, @@ -194,7 +204,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { null, mapTypeParameters(dri), ancestors, - listOf(platformData), + listOf(sourceSetData), PropertyContainer.empty<DInterface>() + annotations.toList().toExtra() ) else -> DClass( @@ -210,8 +220,9 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { mapTypeParameters(dri), ancestors, documentation, + null, modifiers, - listOf(platformData), + listOf(sourceSetData), PropertyContainer.empty<DClass>() + annotations.toList().toExtra() ) } @@ -232,18 +243,20 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { dri.copy(target = index + 1), psiParameter.name, javadocParser.parseDocumentation(psiParameter).toPlatformDependant(), + null, getBound(psiParameter.type), - listOf(platformData) + listOf(sourceSetData) ) }, javadocParser.parseDocumentation(psi).toPlatformDependant(), + null, PsiDocumentableSource(psi).toPlatformDependant(), psi.getVisibility().toPlatformDependant(), psi.returnType?.let { getBound(type = it) } ?: Void, psi.mapTypeParameters(dri), null, psi.getModifier().toPlatformDependant(), - listOf(platformData), + listOf(sourceSetData), PropertyContainer.withAll( InheritedFunction(isInherited), psi.annotations.toList().toExtra(), @@ -313,8 +326,9 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { dri.copy(genericTarget = index), type.name.orEmpty(), javadocParser.parseDocumentation(type).toPlatformDependant(), + null, mapBounds(type.bounds), - listOf(platformData) + listOf(sourceSetData) ) } } @@ -349,6 +363,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { dri, psi.name!!, // TODO: Investigate if this is indeed nullable javadocParser.parseDocumentation(psi).toPlatformDependant(), + null, PsiDocumentableSource(psi).toPlatformDependant(), psi.getVisibility().toPlatformDependant(), getBound(psi.type), @@ -356,7 +371,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { accessors.firstOrNull { it.hasParameters() }?.let { parseFunction(it) }, accessors.firstOrNull { it.returnType == psi.type }?.let { parseFunction(it) }, psi.getModifier().toPlatformDependant(), - listOf(platformData), + listOf(sourceSetData), emptyList(), PropertyContainer.empty<DProperty>() + psi.annotations.toList().toExtra() ) diff --git a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt index ef97b04c..3b69a54e 100644 --- a/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt +++ b/plugins/base/src/test/kotlin/expect/AbstractExpectTest.kt @@ -17,7 +17,7 @@ abstract class AbstractExpectTest( format = outFormat passes { pass { - sourceRoots = listOf(path.asString()) + sourceRoots = listOf(path.toAbsolutePath().asString()) } } } diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt index bf1d52d8..1299bf80 100644 --- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt +++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt @@ -29,6 +29,7 @@ class LinkableContentTest : AbstractCoreTest() { sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { "$testDataDir/$it/kotlin" } + sourceSetName = "js" includes = listOf("$includesDir/include2.md") } pass { @@ -38,6 +39,7 @@ class LinkableContentTest : AbstractCoreTest() { sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { "$testDataDir/$it/kotlin" } + sourceSetName = "jvm" includes = listOf("$includesDir/include1.md") } } @@ -73,6 +75,7 @@ class LinkableContentTest : AbstractCoreTest() { lineSuffix = "#L" ) ) + sourceSetName = "js" } pass { moduleName = "example" @@ -86,6 +89,7 @@ class LinkableContentTest : AbstractCoreTest() { lineSuffix = "#L" ) ) + sourceSetName = "jvm" } } } @@ -129,6 +133,7 @@ class LinkableContentTest : AbstractCoreTest() { analysisPlatform = "js" targets = listOf("js") sourceRoots = listOf("$testDataDir/jsMain/kotlin") + sourceSetName = "js" samples = listOf("$testDataDir/jsMain/resources/Samples.kt") } pass { @@ -136,6 +141,7 @@ class LinkableContentTest : AbstractCoreTest() { analysisPlatform = "jvm" targets = listOf("jvm") sourceRoots = listOf("$testDataDir/jvmMain/kotlin") + sourceSetName = "jvm" samples = listOf("$testDataDir/jvmMain/resources/Samples.kt") } } diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index ee109ba1..a349e54a 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -1,9 +1,7 @@ package model -import org.jetbrains.dokka.Platform import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.KotlinModifier.* -import org.jetbrains.dokka.pages.PlatformData import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Test import utils.AbstractModelTest @@ -169,7 +167,7 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class ) { with((this / "classes" / "Klass").cast<DClass>()) { name equals "Klass" - modifier.allValues.forEach { it equals Sealed } + modifier.values.forEach { it equals Sealed } } } } @@ -211,15 +209,15 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class val D = (this / "classes" / "D").cast<DClass>() with(C) { - modifier.allValues.forEach { it equals Open } + modifier.values.forEach { it equals Open } with((this / "f").cast<DFunction>()) { - modifier.allValues.forEach { it equals Open } + modifier.values.forEach { it equals Open } } } with(D) { - modifier.allValues.forEach { it equals Final } + modifier.values.forEach { it equals Final } with((this / "f").cast<DFunction>()) { - modifier.allValues.forEach { it equals Open } + modifier.values.forEach { it equals Open } } D.supertypes.flatMap { it.component2() }.firstOrNull() equals C.dri } @@ -246,16 +244,16 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class val E = (this / "classes" / "E").cast<DClass>() with(C) { - modifier.allValues.forEach { it equals Abstract } - ((this / "foo").cast<DFunction>()).modifier.allValues.forEach { it equals Abstract } + modifier.values.forEach { it equals Abstract } + ((this / "foo").cast<DFunction>()).modifier.values.forEach { it equals Abstract } } with(D) { - modifier.allValues.forEach { it equals Abstract } + modifier.values.forEach { it equals Abstract } } with(E) { - modifier.allValues.forEach { it equals Final } + modifier.values.forEach { it equals Final } } D.supers.firstOrNull() equals C.dri diff --git a/plugins/base/src/test/kotlin/model/InheritorsTest.kt b/plugins/base/src/test/kotlin/model/InheritorsTest.kt index ee445b5d..ce8a87ca 100644 --- a/plugins/base/src/test/kotlin/model/InheritorsTest.kt +++ b/plugins/base/src/test/kotlin/model/InheritorsTest.kt @@ -30,8 +30,8 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", pluginsOverrides = listOf(InheritorsPlugin) ) { with((this / "inheritors" / "A").cast<DInterface>()) { - val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value.map - with(map.keys.also { it counts 1 }.find { it.platformType == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! } + val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value + with(map.keys.also { it counts 1 }.find { it.platform == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! } ) { this counts 1 first().classNames equals "B" @@ -77,13 +77,13 @@ class InheritorsTest : AbstractModelTest("/src/main/kotlin/inheritors/Test.kt", ) { documentablesTransformationStage = { m -> with((m / "inheritors" / "A").cast<DInterface>()) { - val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value.map + val map = extra[InheritorsInfo].assertNotNull("InheritorsInfo").value with(map.keys.also { it counts 2 }) { - with(find { it.platformType == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! }) { + with(find { it.platform == Platform.jvm }.assertNotNull("jvm key").let { map[it]!! }) { this counts 1 first().classNames equals "B" } - with(find { it.platformType == Platform.js }.assertNotNull("js key").let { map[it]!! }) { + with(find { it.platform == Platform.js }.assertNotNull("js key").let { map[it]!! }) { this counts 2 val classes = listOf("B", "C") assertTrue(all { classes.contains(it.classNames) }, "One of subclasses missing in js" ) diff --git a/plugins/base/src/test/kotlin/model/JavaTest.kt b/plugins/base/src/test/kotlin/model/JavaTest.kt index 20543c8f..a58b380c 100644 --- a/plugins/base/src/test/kotlin/model/JavaTest.kt +++ b/plugins/base/src/test/kotlin/model/JavaTest.kt @@ -112,7 +112,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { with((this / "java" / "Foo").cast<DClass>()) { val sups = listOf("Exception", "Cloneable") assertTrue( - sups.all { s -> supertypes.map.values.flatten().any { it.classNames == s } }) + sups.all { s -> supertypes.values.flatten().any { it.classNames == s } }) "Foo must extend ${sups.joinToString(", ")}" } } @@ -410,7 +410,7 @@ class JavaTest : AbstractModelTest("/src/main/kotlin/java/Test.java", "java") { val dri = (this / "Bar").assertNotNull("Foo dri").dri with((this / "Foo").cast<DClass>()) { with(extra[InheritorsInfo].assertNotNull("InheritorsInfo")) { - with(value.map.values.flatten().distinct()) { + with(value.values.flatten().distinct()) { this counts 1 first() equals dri } diff --git a/plugins/base/src/test/kotlin/model/PackagesTest.kt b/plugins/base/src/test/kotlin/model/PackagesTest.kt index 11d456ce..676f034a 100644 --- a/plugins/base/src/test/kotlin/model/PackagesTest.kt +++ b/plugins/base/src/test/kotlin/model/PackagesTest.kt @@ -14,8 +14,8 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac """.trimIndent(), prependPackage = false ) { - with((this / "[jvm root]").cast<DPackage>()) { - name equals "[jvm root]" + with((this / "[main root]").cast<DPackage>()) { + name equals "[main root]" children counts 0 } } diff --git a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt index 237f4fd9..dd4d1ee0 100644 --- a/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/RenderingOnlyTestBase.kt @@ -14,6 +14,8 @@ import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransfo import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.Documentable +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.model.doc.DocTag import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.* @@ -34,6 +36,7 @@ abstract class RenderingOnlyTestBase { DokkaBase().htmlPreprocessors to { _ -> RootCreator }, DokkaBase().externalLocationProviderFactory to { _ -> ::JavadocExternalLocationProviderFactory }, DokkaBase().externalLocationProviderFactory to { _ -> ::DokkaExternalLocationProviderFactory }, + sourceSetCache = SourceSetCache(), testConfiguration = DokkaConfigurationImpl("", "", false, null, emptyList(), emptyList(), emptyList(), emptyMap()) ) @@ -105,7 +108,7 @@ internal object EmptyCommentConverter : CommentsToContentConverter { override fun buildContent( docTag: DocTag, dci: DCI, - platforms: Set<PlatformData>, + sourceSets: Set<SourceSetData>, styles: Set<Style>, extras: PropertyContainer<ContentNode> ): List<ContentNode> = emptyList() @@ -113,7 +116,7 @@ internal object EmptyCommentConverter : CommentsToContentConverter { internal object EmptyLocationProviderFactory: LocationProviderFactory { override fun getLocationProvider(pageNode: RootPageNode) = object : LocationProvider { - override fun resolve(dri: DRI, platforms: List<PlatformData>, context: PageNode?): String = "" + override fun resolve(dri: DRI, sourceSets: List<SourceSetData>, context: PageNode?): String = "" override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean): String = node.name diff --git a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt deleted file mode 100644 index cf1ac0a9..00000000 --- a/plugins/base/src/test/kotlin/renderers/html/PlatformDependentHintTest.kt +++ /dev/null @@ -1,120 +0,0 @@ -package renderers.html - -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.base.renderers.html.HtmlRenderer -import org.jetbrains.dokka.pages.PlatformData -import org.jetbrains.dokka.pages.TextStyle -import org.junit.jupiter.api.Test -import renderers.Div -import renderers.RenderingOnlyTestBase -import renderers.TestPage -import renderers.match - -class PlatformDependentHintTest : RenderingOnlyTestBase() { - private val pl1 = PlatformData("pl1", Platform.js, listOf("pl1")) - private val pl2 = PlatformData("pl2", Platform.jvm, listOf("pl2")) - private val pl3 = PlatformData("pl3", Platform.native, listOf("pl3")) - - @Test - fun platformIndependentCase() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { - text("a") - text("b") - text("c") - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div("abc")))) - } - - @Test - fun completelyDivergentCase() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { - text("a", platformData = setOf(pl1)) - text("b", platformData = setOf(pl2)) - text("c", platformData = setOf(pl3)) - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div("a")), Div(Div("b")), Div(Div("c")))) - } - - @Test - fun overlappingCase() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { - text("a", platformData = setOf(pl1)) - text("b", platformData = setOf(pl1, pl2)) - text("c", platformData = setOf(pl2)) - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div("ab")), Div(Div("bc")))) - } - - @Test - fun caseThatCanBeSimplified() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { - text("a", platformData = setOf(pl1, pl2)) - text("b", platformData = setOf(pl1)) - text("b", platformData = setOf(pl2)) - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div("ab")))) - } - - @Test - fun caseWithGroupBreakingSimplification() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { - group(styles = setOf(TextStyle.Block)) { - text("a", platformData = setOf(pl1, pl2)) - text("b", platformData = setOf(pl1)) - } - text("b", platformData = setOf(pl2)) - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div(Div("ab"))), Div(Div(Div("a"), "b")))) - } - - @Test - fun caseWithGroupNotBreakingSimplification() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2)) { - group { - text("a", platformData = setOf(pl1, pl2)) - text("b", platformData = setOf(pl1)) - } - text("b", platformData = setOf(pl2)) - } - } - - HtmlRenderer(context).render(page) - println(renderedContent) - renderedContent.match(Div(Div("ab"))) - } - - @Test - fun partiallyUnifiedCase() { - val page = TestPage { - platformDependentHint(platformData = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { - text("a", platformData = setOf(pl1)) - text("a", platformData = setOf(pl2)) - text("b", platformData = setOf(pl3)) - } - } - - HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div("a")), Div(Div("b")))) - } -}
\ No newline at end of file diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt new file mode 100644 index 00000000..f774a09b --- /dev/null +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt @@ -0,0 +1,121 @@ +package renderers.html + +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.SourceRootImpl +import org.jetbrains.dokka.base.renderers.html.HtmlRenderer +import org.jetbrains.dokka.model.SourceSetData +import org.jetbrains.dokka.pages.TextStyle +import org.junit.jupiter.api.Test +import renderers.Div +import renderers.RenderingOnlyTestBase +import renderers.TestPage +import renderers.match + +class SourceSetDependentHintTest : RenderingOnlyTestBase() { + private val pl1 = SourceSetData("root", "pl1", Platform.js, listOf(SourceRootImpl("pl1"))) + private val pl2 = SourceSetData("root","pl2", Platform.jvm, listOf(SourceRootImpl("pl1"))) + private val pl3 = SourceSetData("root","pl3", Platform.native, listOf(SourceRootImpl("pl1"))) + + @Test + fun platformIndependentCase() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { + text("a") + text("b") + text("c") + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div("abc")))) + } + + @Test + fun completelyDivergentCase() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { + text("a", sourceSets = setOf(pl1)) + text("b", sourceSets = setOf(pl2)) + text("c", sourceSets = setOf(pl3)) + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div("a")), Div(Div("b")), Div(Div("c")))) + } + + @Test + fun overlappingCase() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { + text("a", sourceSets = setOf(pl1)) + text("b", sourceSets = setOf(pl1, pl2)) + text("c", sourceSets = setOf(pl2)) + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div("ab")), Div(Div("bc")))) + } + + @Test + fun caseThatCanBeSimplified() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { + text("a", sourceSets = setOf(pl1, pl2)) + text("b", sourceSets = setOf(pl1)) + text("b", sourceSets = setOf(pl2)) + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div("ab")))) + } + + @Test + fun caseWithGroupBreakingSimplification() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2), styles = setOf(TextStyle.Block)) { + group(styles = setOf(TextStyle.Block)) { + text("a", sourceSets = setOf(pl1, pl2)) + text("b", sourceSets = setOf(pl1)) + } + text("b", sourceSets = setOf(pl2)) + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div(Div("ab"))), Div(Div(Div("a"), "b")))) + } + + @Test + fun caseWithGroupNotBreakingSimplification() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2)) { + group { + text("a", sourceSets = setOf(pl1, pl2)) + text("b", sourceSets = setOf(pl1)) + } + text("b", sourceSets = setOf(pl2)) + } + } + + HtmlRenderer(context).render(page) + println(renderedContent) + renderedContent.match(Div(Div("ab"))) + } + + @Test + fun partiallyUnifiedCase() { + val page = TestPage { + sourceSetDependentHint(sourceSets = setOf(pl1, pl2, pl3), styles = setOf(TextStyle.Block)) { + text("a", sourceSets = setOf(pl1)) + text("a", sourceSets = setOf(pl2)) + text("b", sourceSets = setOf(pl3)) + } + } + + HtmlRenderer(context).render(page) + renderedContent.match(Div(Div(Div("a")), Div(Div("b")))) + } +}
\ No newline at end of file diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html index 35fe78dc..29daddec 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/f.html index 6ca7daa7..8044ccbf 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/index.html index d1b41977..9668ba81 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/package-list index 8f1c5fd9..aed2a34c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/scripts/pages.js b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/scripts/pages.js new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/plugins/base/src/test/resources/expect/annotatedFunction/out/html/scripts/pages.js diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html index a7486efc..0a2d2041 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/navigation.html @@ -1,12 +1,12 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0-0" pageId="[jvm root]/Fancy////"> - <div class="overview"><a href="root/[jvm root]/-fancy/index.html">Fancy</a></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0-0" pageId="[main root]/Fancy////"> + <div class="overview"><a href="root/[main root]/-fancy/index.html">Fancy</a></div> </div> <div class="sideMenuPart" id="nav-submenu-0-1" pageId="//f/#//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/-init-.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/-init-.html index 6e578700..0ce13e70 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/-init-.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/-init-.html @@ -18,11 +18,11 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/Fancy/<init>/#kotlin.Int//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="-init-.html"><init></a></div> + <div id="content" pageIds="[main root]/Fancy/<init>/#kotlin.Int//"> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="-init-.html"><init></a></div> <div class="cover "> <h1><init></h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="-init-.html"><init></a>(size: <a href="">Int</a>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="-init-.html"><init></a>(size: <a href="">Int</a>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/equals.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/equals.html index 52566473..5de2c68d 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/equals.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/equals.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/equals/#kotlin.Any?//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="equals.html">equals</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="equals.html">equals</a></div> <div class="cover "> <h1>equals</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/hash-code.html index 98338519..675c156f 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/hash-code.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/hash-code.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/hashCode/#//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="hash-code.html">hashCode</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="hash-code.html">hashCode</a></div> <div class="cover "> <h1>hashCode</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/index.html index 6ff4bf1e..984c084b 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/index.html @@ -18,11 +18,11 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/Fancy////"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a></div> + <div id="content" pageIds="[main root]/Fancy////"> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a></div> <div class="cover "> <h1>Fancy</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">annotation class <a href="index.html">Fancy</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">annotation class <a href="index.html">Fancy</a></div></div></div> </div> <h2>Functions</h2> <div class="table"> @@ -33,12 +33,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div></div> </div> </div> </div> @@ -49,12 +49,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div></div> </div> </div> </div> @@ -65,12 +65,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div></div> </div> </div> </div> @@ -84,12 +84,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final val <a href="">size</a>: <a href="">Int</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final val <a href="">size</a>: <a href="">Int</a></div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/to-string.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/to-string.html index b64fcf93..4e1a0346 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/to-string.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/-fancy/to-string.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/toString/#//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="to-string.html">toString</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="to-string.html">toString</a></div> <div class="cover "> <h1>toString</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/f.html index 6ca7daa7..8044ccbf 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/index.html index 59652a6d..9b60126a 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Types</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">annotation class <a href="-fancy/index.html">Fancy</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">annotation class <a href="-fancy/index.html">Fancy</a></div></div></div></div> </div> </div> </div> @@ -51,12 +51,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/package-list b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/package-list index 8dcb9116..a5413b7c 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/package-list @@ -1,8 +1,8 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#//root/[jvm root]/f.html -$dokka.location:/Fancy/equals/#kotlin.Any?//root/[jvm root]/-fancy/equals.html -$dokka.location:/Fancy/hashCode/#//root/[jvm root]/-fancy/hash-code.html -$dokka.location:/Fancy/toString/#//root/[jvm root]/-fancy/to-string.html -[jvm root] +$dokka.location://f/#//root/[main root]/f.html +$dokka.location:/Fancy/equals/#kotlin.Any?//root/[main root]/-fancy/equals.html +$dokka.location:/Fancy/hashCode/#//root/[main root]/-fancy/hash-code.html +$dokka.location:/Fancy/toString/#//root/[main root]/-fancy/to-string.html +[main root] diff --git a/plugins/base/src/test/resources/expect/function/out/html/navigation.html b/plugins/base/src/test/resources/expect/function/out/html/navigation.html index 3e532bec..f9058a8f 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/function/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//fn/#//"> - <div class="overview"><a href="root/[jvm root]/fn.html">fn</a></div> + <div class="overview"><a href="root/[main root]/fn.html">fn</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/fn.html b/plugins/base/src/test/resources/expect/function/out/html/root/[main root]/fn.html index abb882ae..775304da 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/fn.html +++ b/plugins/base/src/test/resources/expect/function/out/html/root/[main root]/fn.html @@ -19,13 +19,13 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//fn/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="fn.html">fn</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="fn.html">fn</a></div> <div class="cover "> <h1>fn</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="fn.html">fn</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="fn.html">fn</a>()</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">Function fn</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">Function fn</div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/function/out/html/root/[main root]/index.html index c7b72589..bc7f8f86 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/function/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="fn.html">fn</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="fn.html">fn</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/index.html b/plugins/base/src/test/resources/expect/function/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/function/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/function/out/html/root/package-list b/plugins/base/src/test/resources/expect/function/out/html/root/package-list index 9430f445..d0e46007 100644 --- a/plugins/base/src/test/resources/expect/function/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/function/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://fn/#//root/[jvm root]/fn.html -[jvm root] +$dokka.location://fn/#//root/[main root]/fn.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html index df89ba77..dd3ea05b 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/navigation.html @@ -1,12 +1,12 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0-0" pageId="[jvm root]/Fancy////"> - <div class="overview"><a href="root/[jvm root]/-fancy/index.html">Fancy</a></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0-0" pageId="[main root]/Fancy////"> + <div class="overview"><a href="root/[main root]/-fancy/index.html">Fancy</a></div> </div> <div class="sideMenuPart" id="nav-submenu-0-1" pageId="//function/#kotlin.Function0[kotlin.Unit]//"> - <div class="overview"><a href="root/[jvm root]/function.html">function</a></div> + <div class="overview"><a href="root/[main root]/function.html">function</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/-init-.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/-init-.html index 5aa8aba5..80bf13d6 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/-init-.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/-init-.html @@ -18,11 +18,11 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/Fancy/<init>/#//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="-init-.html"><init></a></div> + <div id="content" pageIds="[main root]/Fancy/<init>/#//"> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="-init-.html"><init></a></div> <div class="cover "> <h1><init></h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="-init-.html"><init></a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="-init-.html"><init></a>()</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/equals.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/equals.html index 52566473..5de2c68d 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/equals.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/equals.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/equals/#kotlin.Any?//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="equals.html">equals</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="equals.html">equals</a></div> <div class="cover "> <h1>equals</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/hash-code.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/hash-code.html index 98338519..675c156f 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/hash-code.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/hash-code.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/hashCode/#//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="hash-code.html">hashCode</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="hash-code.html">hashCode</a></div> <div class="cover "> <h1>hashCode</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/index.html index 14804ca4..7445b029 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/-fancy/index.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/index.html @@ -18,11 +18,11 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/Fancy////"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a></div> + <div id="content" pageIds="[main root]/Fancy////"> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a></div> <div class="cover "> <h1>Fancy</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">annotation class <a href="index.html">Fancy</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">annotation class <a href="index.html">Fancy</a></div></div></div> </div> <h2>Functions</h2> <div class="table"> @@ -33,12 +33,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="equals.html">equals</a>(other: <a href="">Any</a>): <a href="">Boolean</a></div></div></div></div> </div> </div> </div> @@ -49,12 +49,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="hash-code.html">hashCode</a>(): <a href="">Int</a></div></div></div></div> </div> </div> </div> @@ -65,12 +65,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/to-string.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/to-string.html index b64fcf93..4e1a0346 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunctionWithAnnotationParameters/out/html/root/[jvm root]/-fancy/to-string.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/-fancy/to-string.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../../scripts/pages.js"></script> <script type="text/javascript" src="../../../scripts/main.js"></script> <div id="content" pageIds="/Fancy/toString/#//"> - <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[jvm root]</a>/<a href="index.html">Fancy</a>/<a href="to-string.html">toString</a></div> + <div class="breadcrumbs">//<a href="../../index.html">root</a>/<a href="../index.html">[main root]</a>/<a href="index.html">Fancy</a>/<a href="to-string.html">toString</a></div> <div class="cover "> <h1>toString</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">open fun <a href="to-string.html">toString</a>(): <a href="">String</a></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/function.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/function.html index d4436f44..d7f9f550 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/function.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/function.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//function/#kotlin.Function0[kotlin.Unit]//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="function.html">function</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="function.html">function</a></div> <div class="cover "> <h1>function</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/index.html index e51fe2b2..b4ad01f5 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Types</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">annotation class <a href="-fancy/index.html">Fancy</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">annotation class <a href="-fancy/index.html">Fancy</a></div></div></div></div> </div> </div> </div> @@ -51,12 +51,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/package-list index 141e96fd..fb79fbe8 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/package-list @@ -1,8 +1,8 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://function/#kotlin.Function0[kotlin.Unit]//root/[jvm root]/function.html -$dokka.location:/Fancy/equals/#kotlin.Any?//root/[jvm root]/-fancy/equals.html -$dokka.location:/Fancy/hashCode/#//root/[jvm root]/-fancy/hash-code.html -$dokka.location:/Fancy/toString/#//root/[jvm root]/-fancy/to-string.html -[jvm root] +$dokka.location://function/#kotlin.Function0[kotlin.Unit]//root/[main root]/function.html +$dokka.location:/Fancy/equals/#kotlin.Any?//root/[main root]/-fancy/equals.html +$dokka.location:/Fancy/hashCode/#//root/[main root]/-fancy/hash-code.html +$dokka.location:/Fancy/toString/#//root/[main root]/-fancy/to-string.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html index 6d159123..7edbae7d 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#kotlin.String//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/f.html index c395f3b6..dedf121b 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#kotlin.String//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>(x: <a href="">String</a>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>(x: <a href="">String</a>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/index.html index 9e048fbe..47b5a8ae 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(x: <a href="">String</a>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(x: <a href="">String</a>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/package-list index 2887ed99..e733b252 100644 --- a/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithDefaultParameter/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#kotlin.String//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#kotlin.String//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html index b3a068a3..e75d2599 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//function/#kotlin.Function0[kotlin.Unit]//"> - <div class="overview"><a href="root/[jvm root]/function.html">function</a></div> + <div class="overview"><a href="root/[main root]/function.html">function</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/function.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/function.html index d4436f44..d7f9f550 100644 --- a/plugins/base/src/test/resources/expect/functionWithAnnotatedParam/out/html/root/[jvm root]/function.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/function.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//function/#kotlin.Function0[kotlin.Unit]//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="function.html">function</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="function.html">function</a></div> <div class="cover "> <h1>function</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/index.html index 4825e352..8201541c 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(notInlined: <div class="symbol monospace">() -> <a href="">Unit</a></div>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/package-list index 4200e2d8..73470d00 100644 --- a/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithNoinlineParam/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://function/#kotlin.Function0[kotlin.Unit]//root/[jvm root]/function.html -[jvm root] +$dokka.location://function/#kotlin.Function0[kotlin.Unit]//root/[main root]/function.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html index 35fe78dc..29daddec 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/f.html index 6ca7daa7..8044ccbf 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/index.html index d1b41977..9668ba81 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/package-list index 8f1c5fd9..aed2a34c 100644 --- a/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithNotDocumentedAnnotation/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html index 9e098fd0..2b6b4beb 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//function/#kotlin.Int//"> - <div class="overview"><a href="root/[jvm root]/function.html">function</a></div> + <div class="overview"><a href="root/[main root]/function.html">function</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/function.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/function.html index 0fb966a6..98af2216 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/function.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/function.html @@ -19,13 +19,13 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//function/#kotlin.Int//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="function.html">function</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="function.html">function</a></div> <div class="cover "> <h1>function</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="function.html">function</a>(x: <a href="">Int</a>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="function.html">function</a>(x: <a href="">Int</a>)</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">MultilineFunction Documentation</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">MultilineFunction Documentation</div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/index.html index 31271e45..e2a0259d 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(x: <a href="">Int</a>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="function.html">function</a>(x: <a href="">Int</a>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/package-list index 6394d253..445b2e70 100644 --- a/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithParams/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://function/#kotlin.Int//root/[jvm root]/function.html -[jvm root] +$dokka.location://function/#kotlin.Int//root/[main root]/function.html +[main root] diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html index d5d3a9f4..daefbd81 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//fn/kotlin.String#//"> - <div class="overview"><a href="root/[jvm root]/fn.html">fn</a></div> + <div class="overview"><a href="root/[main root]/fn.html">fn</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/fn.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/fn.html index a922d72f..03feac23 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/fn.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/fn.html @@ -19,19 +19,19 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//fn/kotlin.String#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="fn.html">fn</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="fn.html">fn</a></div> <div class="cover "> <h1>fn</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>()</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">Function with receiver</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">Function with receiver</div></div> <div class="cover "> <h1>fn</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>(x: <a href="">Int</a>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>(x: <a href="">Int</a>)</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">Function with receiver</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">Function with receiver</div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/index.html index a646eb63..164f42e9 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>()</div></div></div></div> </div> </div> </div> @@ -48,12 +48,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>(x: <a href="">Int</a>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="">String</a>.<a href="fn.html">fn</a>(x: <a href="">Int</a>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/package-list b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/package-list index faeb244b..42c919d9 100644 --- a/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/functionWithReceiver/out/html/root/package-list @@ -1,6 +1,6 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://fn/kotlin.String#//root/[jvm root]/fn.html -$dokka.location://fn/kotlin.String#kotlin.Int//root/[jvm root]/fn.html -[jvm root] +$dokka.location://fn/kotlin.String#//root/[main root]/fn.html +$dokka.location://fn/kotlin.String#kotlin.Int//root/[main root]/fn.html +[main root] diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html index 006a9e3e..cddadabd 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//generic/#//"> - <div class="overview"><a href="root/[jvm root]/generic.html">generic</a></div> + <div class="overview"><a href="root/[main root]/generic.html">generic</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/generic.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/generic.html index 91519d2b..de568b54 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/generic.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/generic.html @@ -19,13 +19,13 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//generic/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="generic.html">generic</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="generic.html">generic</a></div> <div class="cover "> <h1>generic</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">private final fun <<a href="generic.html">T</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">private final fun <<a href="generic.html">T</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">generic function</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">generic function</div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/index.html index 89261f63..65c8f4b6 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">private final fun <<a href="generic.html">T</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">private final fun <<a href="generic.html">T</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/package-list index 468c6cb4..328a6811 100644 --- a/plugins/base/src/test/resources/expect/genericFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/genericFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://generic/#//root/[jvm root]/generic.html -[jvm root] +$dokka.location://generic/#//root/[main root]/generic.html +[main root] diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html index 006a9e3e..cddadabd 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//generic/#//"> - <div class="overview"><a href="root/[jvm root]/generic.html">generic</a></div> + <div class="overview"><a href="root/[main root]/generic.html">generic</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/generic.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/generic.html index 3e44781b..af73a7ae 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/generic.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/generic.html @@ -19,13 +19,13 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//generic/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="generic.html">generic</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="generic.html">generic</a></div> <div class="cover "> <h1>generic</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <<a href="generic.html">T</a> : R, <a href="generic.html">R</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <<a href="generic.html">T</a> : R, <a href="generic.html">R</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">generic function</div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">generic function</div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/index.html index 4d02021a..6d091562 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <<a href="generic.html">T</a> : R, <a href="generic.html">R</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <<a href="generic.html">T</a> : R, <a href="generic.html">R</a> : <a href="">Any</a>> <a href="generic.html">generic</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/package-list b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/package-list index 468c6cb4..328a6811 100644 --- a/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/genericFunctionWithConstraints/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://generic/#//root/[jvm root]/generic.html -[jvm root] +$dokka.location://generic/#//root/[main root]/generic.html +[main root] diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html index f949d074..b3656a55 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#kotlin.Function0[kotlin.String]//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/f.html index 3766ad15..f6fdb40a 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#kotlin.Function0[kotlin.String]//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/index.html index 26d40926..79216743 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/package-list index ce137c16..26e2f605 100644 --- a/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/inlineFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html index f949d074..b3656a55 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#kotlin.Function0[kotlin.String]//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/index.html deleted file mode 100644 index 26d40926..00000000 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/index.html +++ /dev/null @@ -1,50 +0,0 @@ -<html> - <head> - <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> - <link href="../../styles/style.css" rel="Stylesheet"> - <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> - <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> - <script type="text/javascript" src="../../scripts/platformContentHandler.js" async="async"></script> - <script>var pathToRoot = "../../";</script> - </head> - <body> - <div id="container"> - <div id="leftColumn"> - <div id="logo"></div> - <div id="sideMenu"></div> - </div> - <div id="main"> - <div id="searchBar"></div> - <script type="text/javascript" src="../../scripts/pages.js"></script> - <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> - <div class="cover "> - <h1>Package [jvm root]</h1> - </div> - <h2>Functions</h2> - <div class="table"> - <div class="table-row"> - <div class="main-subrow"> - <div class="title"><a href="f.html">f</a></div> - <div class="brief"> - <div class="brief "> </div> - </div> - <div class="platform-tags"> - <div class="platform-tag">jvm</div> - </div> - </div> - <div class="signature-subrow"> - <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> - </div> - </div> - </div> - </div> - </div> - </div> - </div> - </body> -</html> - diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/f.html index 3766ad15..f6fdb40a 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#kotlin.Function0[kotlin.String]//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/index.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/index.html new file mode 100644 index 00000000..79216743 --- /dev/null +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/[main root]/index.html @@ -0,0 +1,50 @@ +<html> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> + <title>[main root]</title> + <link href="../../styles/style.css" rel="Stylesheet"> + <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> + <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> + <script type="text/javascript" src="../../scripts/platformContentHandler.js" async="async"></script> + <script>var pathToRoot = "../../";</script> + </head> + <body> + <div id="container"> + <div id="leftColumn"> + <div id="logo"></div> + <div id="sideMenu"></div> + </div> + <div id="main"> + <div id="searchBar"></div> + <script type="text/javascript" src="../../scripts/pages.js"></script> + <script type="text/javascript" src="../../scripts/main.js"></script> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> + <div class="cover "> + <h1>Package [main root]</h1> + </div> + <h2>Functions</h2> + <div class="table"> + <div class="table-row"> + <div class="main-subrow"> + <div class="title"><a href="f.html">f</a></div> + <div class="brief"> + <div class="brief "> </div> + </div> + <div class="platform-tags"> + <div class="platform-tag">main</div> + </div> + </div> + <div class="signature-subrow"> + <div class="signatures"> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </body> +</html> + diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/package-list index ce137c16..26e2f605 100644 --- a/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/inlineSuspendFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html index fd166ca9..03fe3b32 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/index.html @@ -29,7 +29,7 @@ <div class="main-subrow"> <div class="title"><a href="signatureTest/index.html">signatureTest</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html index 8d27b36e..4147b88e 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/index.html @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="test.html">test</a>(i: <div class="symbol monospace">(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="test.html">test</a>(i: <div class="symbol monospace">(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div></div> </div> </div> </div> @@ -48,12 +48,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="test2.html">test2</a>(i: <div class="symbol monospace"><a href="">Int</a>.(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="test2.html">test2</a>(i: <div class="symbol monospace"><a href="">Int</a>.(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html index 0252ebc5..333ee75a 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test.html @@ -22,7 +22,7 @@ <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">signatureTest</a>/<a href="test.html">test</a></div> <div class="cover "> <h1>test</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="test.html">test</a>(i: <div class="symbol monospace">(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="test.html">test</a>(i: <div class="symbol monospace">(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html index ab388675..ebc34123 100644 --- a/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html +++ b/plugins/base/src/test/resources/expect/signatureTest/out/html/root/signatureTest/test2.html @@ -22,7 +22,7 @@ <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">signatureTest</a>/<a href="test2.html">test2</a></div> <div class="cover "> <h1>test2</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="test2.html">test2</a>(i: <div class="symbol monospace"><a href="">Int</a>.(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="test2.html">test2</a>(i: <div class="symbol monospace"><a href="">Int</a>.(<a href="">Int</a>) -> <a href="">Int</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html index ff1a753c..8e375351 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//availableSince1.1/#//"> - <div class="overview"><a href="root/[jvm root]/available-since1.1.html">availableSince1.1</a></div> + <div class="overview"><a href="root/[main root]/available-since1.1.html">availableSince1.1</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/available-since1.1.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/available-since1.1.html index cdf2898c..d02eb734 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/available-since1.1.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/available-since1.1.html @@ -19,13 +19,13 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//availableSince1.1/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="available-since1.1.html">availableSince1.1</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="available-since1.1.html">availableSince1.1</a></div> <div class="cover "> <h1>availableSince1.1</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="available-since1.1.html">availableSince1.1</a>(): <a href="">String</a></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="available-since1.1.html">availableSince1.1</a>(): <a href="">String</a></div></div></div> </div> <h3>Description</h3> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm">Quite useful <a href="">String</a></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main">Quite useful <a href="">String</a></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/index.html index ee56ace9..cde151a7 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="available-since1.1.html">availableSince1.1</a>(): <a href="">String</a></div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="available-since1.1.html">availableSince1.1</a>(): <a href="">String</a></div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/package-list b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/package-list index adc667ec..c90f53ec 100644 --- a/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/sinceKotlin/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://availableSince1.1/#//root/[jvm root]/available-since1.1.html -[jvm root] +$dokka.location://availableSince1.1/#//root/[main root]/available-since1.1.html +[main root] diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html index 35fe78dc..29daddec 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/f.html index 6ca7daa7..8044ccbf 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/index.html index d1b41977..9668ba81 100644 --- a/plugins/base/src/test/resources/expect/annotatedFunction/out/html/root/[jvm root]/index.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/[main root]/index.html @@ -1,7 +1,7 @@ <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> + <title>[main root]</title> <link href="../../styles/style.css" rel="Stylesheet"> <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> @@ -18,10 +18,10 @@ <div id="searchBar"></div> <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> <div class="cover "> - <h1>Package [jvm root]</h1> + <h1>Package [main root]</h1> </div> <h2>Functions</h2> <div class="table"> @@ -32,12 +32,12 @@ <div class="brief "> </div> </div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> <div class="signature-subrow"> <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>()</div></div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/package-list index 8f1c5fd9..aed2a34c 100644 --- a/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/suspendFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#//root/[main root]/f.html +[main root] diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html index f949d074..b3656a55 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/navigation.html @@ -1,9 +1,9 @@ <div class="sideMenuPart" id="nav-submenu" pageId="/////"> <div class="overview"><a href="root/index.html">root</a><span class="navButton" onclick="document.getElementById("nav-submenu").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> - <div class="sideMenuPart" id="nav-submenu-0" pageId="[jvm root]/////"> - <div class="overview"><a href="root/[jvm root]/index.html">[jvm root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> + <div class="sideMenuPart" id="nav-submenu-0" pageId="[main root]/////"> + <div class="overview"><a href="root/[main root]/index.html">[main root]</a><span class="navButton" onclick="document.getElementById("nav-submenu-0").classList.toggle("hidden");"><span class="navButtonContent"></span></span></div> <div class="sideMenuPart" id="nav-submenu-0-0" pageId="//f/#kotlin.Function0[kotlin.String]//"> - <div class="overview"><a href="root/[jvm root]/f.html">f</a></div> + <div class="overview"><a href="root/[main root]/f.html">f</a></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/index.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/index.html deleted file mode 100644 index 26d40926..00000000 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/index.html +++ /dev/null @@ -1,50 +0,0 @@ -<html> - <head> - <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> - <title>[jvm root]</title> - <link href="../../styles/style.css" rel="Stylesheet"> - <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> - <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> - <script type="text/javascript" src="../../scripts/platformContentHandler.js" async="async"></script> - <script>var pathToRoot = "../../";</script> - </head> - <body> - <div id="container"> - <div id="leftColumn"> - <div id="logo"></div> - <div id="sideMenu"></div> - </div> - <div id="main"> - <div id="searchBar"></div> - <script type="text/javascript" src="../../scripts/pages.js"></script> - <script type="text/javascript" src="../../scripts/main.js"></script> - <div id="content" pageIds="[jvm root]/////"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a></div> - <div class="cover "> - <h1>Package [jvm root]</h1> - </div> - <h2>Functions</h2> - <div class="table"> - <div class="table-row"> - <div class="main-subrow"> - <div class="title"><a href="f.html">f</a></div> - <div class="brief"> - <div class="brief "> </div> - </div> - <div class="platform-tags"> - <div class="platform-tag">jvm</div> - </div> - </div> - <div class="signature-subrow"> - <div class="signatures"> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> - </div> - </div> - </div> - </div> - </div> - </div> - </div> - </body> -</html> - diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/f.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/f.html index 3766ad15..f6fdb40a 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[jvm root]/f.html +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/f.html @@ -19,10 +19,10 @@ <script type="text/javascript" src="../../scripts/pages.js"></script> <script type="text/javascript" src="../../scripts/main.js"></script> <div id="content" pageIds="//f/#kotlin.Function0[kotlin.String]//"> - <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[jvm root]</a>/<a href="f.html">f</a></div> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a>/<a href="f.html">f</a></div> <div class="cover "> <h1>f</h1> - <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="jvm"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/index.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/index.html new file mode 100644 index 00000000..79216743 --- /dev/null +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/[main root]/index.html @@ -0,0 +1,50 @@ +<html> + <head> + <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8"> + <title>[main root]</title> + <link href="../../styles/style.css" rel="Stylesheet"> + <link href="../../styles/jetbrains-mono.css" rel="Stylesheet"> + <script type="text/javascript" src="../../scripts/navigationLoader.js" async="async"></script> + <script type="text/javascript" src="../../scripts/platformContentHandler.js" async="async"></script> + <script>var pathToRoot = "../../";</script> + </head> + <body> + <div id="container"> + <div id="leftColumn"> + <div id="logo"></div> + <div id="sideMenu"></div> + </div> + <div id="main"> + <div id="searchBar"></div> + <script type="text/javascript" src="../../scripts/pages.js"></script> + <script type="text/javascript" src="../../scripts/main.js"></script> + <div id="content" pageIds="[main root]/////"> + <div class="breadcrumbs">//<a href="../index.html">root</a>/<a href="index.html">[main root]</a></div> + <div class="cover "> + <h1>Package [main root]</h1> + </div> + <h2>Functions</h2> + <div class="table"> + <div class="table-row"> + <div class="main-subrow"> + <div class="title"><a href="f.html">f</a></div> + <div class="brief"> + <div class="brief "> </div> + </div> + <div class="platform-tags"> + <div class="platform-tag">main</div> + </div> + </div> + <div class="signature-subrow"> + <div class="signatures"> + <div class="platform-hinted" data-platform-hinted="data-platform-hinted"><div class="content" data-active="" data-togglable="main"><div class="symbol "><div class="symbol monospace">final fun <a href="f.html">f</a>(a: <div class="symbol monospace">() -> <a href="">String</a></div>)</div></div></div></div> + </div> + </div> + </div> + </div> + </div> + </div> + </div> + </body> +</html> + diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html index 2c55944d..2b62b11c 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/index.html @@ -27,9 +27,9 @@ <div class="table"> <div class="table-row"> <div class="main-subrow"> - <div class="title"><a href="[jvm root]/index.html">[jvm root]</a></div> + <div class="title"><a href="[main root]/index.html">[main root]</a></div> <div class="platform-tags"> - <div class="platform-tag">jvm</div> + <div class="platform-tag">main</div> </div> </div> </div> diff --git a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/package-list b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/package-list index ce137c16..26e2f605 100644 --- a/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/package-list +++ b/plugins/base/src/test/resources/expect/suspendInlineFunction/out/html/root/package-list @@ -1,5 +1,5 @@ $dokka.format:html $dokka.linkExtension:html -$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[jvm root]/f.html -[jvm root] +$dokka.location://f/#kotlin.Function0[kotlin.String]//root/[main root]/f.html +[main root] diff --git a/plugins/gfm/src/main/kotlin/GfmPlugin.kt b/plugins/gfm/src/main/kotlin/GfmPlugin.kt index c65f3673..b7e9f6ab 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.SourceSetData import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin @@ -62,7 +63,7 @@ open class CommonmarkRenderer( append("]($address)") } - override fun StringBuilder.buildList(node: ContentList, pageContext: ContentPage, platformRestriction: PlatformData?) { + override fun StringBuilder.buildList(node: ContentList, pageContext: ContentPage, platformRestriction: SourceSetData?) { buildParagraph() buildListLevel(node, pageContext) buildParagraph() @@ -107,15 +108,15 @@ open class CommonmarkRenderer( } override fun StringBuilder.buildPlatformDependent(content: PlatformHintedContent, pageContext: ContentPage) { - val distinct = content.platforms.map { + val distinct = content.sourceSets.map { it to StringBuilder().apply {buildContentNode(content.inner, pageContext, it) }.toString() - }.groupBy(Pair<PlatformData, String>::second, Pair<PlatformData, String>::first) + }.groupBy(Pair<SourceSetData, String>::second, Pair<SourceSetData, String>::first) if (distinct.size == 1) append(distinct.keys.single()) else distinct.forEach { text, platforms -> - append(platforms.joinToString(prefix = " [", postfix = "] $text") { it.name }) + append(platforms.joinToString(prefix = " [", postfix = "] $text") { "${it.moduleName}/${it.sourceSetName}" }) } } @@ -123,7 +124,7 @@ open class CommonmarkRenderer( append("Resource") } - override fun StringBuilder.buildTable(node: ContentTable, pageContext: ContentPage, platformRestriction: PlatformData?) { + override fun StringBuilder.buildTable(node: ContentTable, pageContext: ContentPage, platformRestriction: SourceSetData?) { buildParagraph() val size = node.children.firstOrNull()?.children?.size ?: 0 diff --git a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt index 0befe077..5a77016d 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/converters/KotlinToJavaConverter.kt @@ -17,7 +17,7 @@ private fun <T : WithExpectActual> List<T>.groupedByLocation() = map { it.sources to it } .groupBy({ (location, _) -> location.let { - it.map.entries.first().value.path.split("/").last().split(".").first() + "Kt" + it.entries.first().value.path.split("/").last().split(".").first() + "Kt" } // TODO: first() does not look reasonable }) { it.second } @@ -37,18 +37,17 @@ internal fun DPackage.asJava(): DPackage { nodes.filterIsInstance<DFunction>() .map { it.asJava(syntheticClassName) }), // TODO: methods are static and receiver is a param classlikes = emptyList(), - sources = PlatformDependent.empty(), - visibility = PlatformDependent( - platformData.map { - it to JavaVisibility.Public - }.toMap() - ), + sources = emptyMap(), + expectPresentInSet = null, + visibility = sourceSets.map { + it to JavaVisibility.Public + }.toMap(), companion = null, generics = emptyList(), - supertypes = PlatformDependent.empty(), - documentation = PlatformDependent.empty(), - modifier = PlatformDependent(map = platformData.map{ it to JavaModifier.Final}.toMap()), - platformData = platformData, + supertypes = emptyMap(), + documentation = emptyMap(), + modifier = sourceSets.map{ it to JavaModifier.Final}.toMap(), + sourceSets = sourceSets, extra = PropertyContainer.empty() ) } @@ -68,13 +67,11 @@ internal fun DProperty.asJava(isTopLevel: Boolean = false, relocateToClass: Stri dri.withClass(relocateToClass) }, modifier = if (setter == null) { - PlatformDependent(map = platformData.map{it to JavaModifier.Final}.toMap()) + sourceSets.map{it to JavaModifier.Final}.toMap() } else { - PlatformDependent(map = platformData.map{it to JavaModifier.Empty}.toMap()) + sourceSets.map{it to JavaModifier.Empty}.toMap() }, - visibility = visibility.copy( - map = visibility.mapValues { JavaVisibility.Private } - ), + visibility = visibility.mapValues { JavaVisibility.Private }, type = type.asJava(), // TODO: check setter = null, getter = null, // Removing getters and setters as they will be available as functions @@ -91,13 +88,11 @@ internal fun DProperty.javaAccessors(isTopLevel: Boolean = false, relocateToClas }, name = "get" + name.capitalize(), modifier = if (setter == null) { - PlatformDependent(map = platformData.map{it to JavaModifier.Final}.toMap()) + sourceSets.map{it to JavaModifier.Final}.toMap() } else { - PlatformDependent(map = platformData.map{it to JavaModifier.Empty}.toMap()) + sourceSets.map{it to JavaModifier.Empty}.toMap() }, - visibility = visibility.copy( - map = visibility.mapValues { JavaVisibility.Public } - ), + visibility = visibility.mapValues { JavaVisibility.Public }, type = type.asJava(), // TODO: check extra = if (isTopLevel) getter!!.extra.plus(getter!!.extra.mergeAdditionalModifiers(setOf(ExtraModifiers.STATIC))) else getter!!.extra ), @@ -109,13 +104,11 @@ internal fun DProperty.javaAccessors(isTopLevel: Boolean = false, relocateToClas }, name = "set" + name.capitalize(), modifier = if (setter == null) { - PlatformDependent(map = platformData.map{it to JavaModifier.Final}.toMap()) + sourceSets.map{it to JavaModifier.Final}.toMap() } else { - PlatformDependent(map = platformData.map{it to JavaModifier.Empty}.toMap()) + sourceSets.map{it to JavaModifier.Empty}.toMap() }, - visibility = visibility.copy( - map = visibility.mapValues { JavaVisibility.Public } - ), + visibility = visibility.mapValues { JavaVisibility.Public }, type = type.asJava(), // TODO: check extra = if (isTopLevel) setter!!.extra.plus(setter!!.extra.mergeAdditionalModifiers(setOf(ExtraModifiers.STATIC))) else setter!!.extra ) @@ -132,8 +125,8 @@ internal fun DFunction.asJava(containingClassName: String): DFunction { name = newName, type = type.asJava(), modifier = if(modifier.all{(_,v)-> v is KotlinModifier.Final} && isConstructor) - PlatformDependent(map = platformData.map{it to JavaModifier.Empty}.toMap()) - else PlatformDependent(map = platformData.map{it to modifier.allValues.first()}.toMap()), + sourceSets.map{it to JavaModifier.Empty}.toMap() + else sourceSets.map{it to modifier.values.first()}.toMap(), parameters = listOfNotNull(receiver?.asJava()) + parameters.map { it.asJava() }, receiver = null ) // TODO static if toplevel @@ -156,11 +149,9 @@ internal fun DClass.asJava(): DClass = copy( properties = properties.map { it.asJava() }, classlikes = classlikes.map { it.asJava() }, generics = generics.map { it.asJava() }, - supertypes = supertypes.copy( - map = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } - ), - modifier = if (modifier.all{(_,v) -> v is KotlinModifier.Empty}) PlatformDependent(map = platformData.map{it to JavaModifier.Final}.toMap()) - else PlatformDependent(map = platformData.map{it to modifier.allValues.first()}.toMap()) + supertypes = supertypes.mapValues { it.value.map { it.possiblyAsJava() } }, + modifier = if (modifier.all{(_,v) -> v is KotlinModifier.Empty}) sourceSets.map{it to JavaModifier.Final}.toMap() + else sourceSets.map{it to modifier.values.first()}.toMap() ) private fun DTypeParameter.asJava(): DTypeParameter = copy( @@ -185,9 +176,7 @@ internal fun DEnum.asJava(): DEnum = copy( }, properties = properties.map { it.asJava() }, classlikes = classlikes.map { it.asJava() }, - supertypes = supertypes.copy( - map = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } - ) + supertypes = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } // , entries = entries.map { it.asJava() } ) @@ -198,27 +187,24 @@ internal fun DObject.asJava(): DObject = copy( properties = properties.map { it.asJava() } + DProperty( name = "INSTANCE", - modifier = PlatformDependent(map = platformData.map{it to JavaModifier.Final}.toMap()), + modifier = sourceSets.map{it to JavaModifier.Final}.toMap(), dri = dri.copy(callable = Callable("INSTANCE", null, emptyList())), - documentation = PlatformDependent.empty(), - sources = PlatformDependent.empty(), - visibility = PlatformDependent( - platformData.map { - it to JavaVisibility.Public - }.toMap() - ), + documentation = emptyMap(), + sources = emptyMap(), + visibility = sourceSets.map { + it to JavaVisibility.Public + }.toMap(), type = TypeConstructor(dri, emptyList()), setter = null, getter = null, - platformData = platformData, + sourceSets = sourceSets, receiver = null, generics = emptyList(), + expectPresentInSet = expectPresentInSet, extra = PropertyContainer.empty<DProperty>() + AdditionalModifiers(setOf(ExtraModifiers.STATIC)) ), classlikes = classlikes.map { it.asJava() }, - supertypes = supertypes.copy( - map = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } - ) + supertypes = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } ) internal fun DInterface.asJava(): DInterface = copy( @@ -228,9 +214,7 @@ internal fun DInterface.asJava(): DInterface = copy( properties = emptyList(), classlikes = classlikes.map { it.asJava() }, // TODO: public static final class DefaultImpls with impls for methods generics = generics.map { it.asJava() }, - supertypes = supertypes.copy( - map = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } - ) + supertypes = supertypes.mapValues { it.value.map { it.possiblyAsJava() } } ) internal fun DAnnotation.asJava(): DAnnotation = copy( diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 66328666..d737cedb 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -54,8 +54,8 @@ class JavaSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLogge } if (c is WithSupertypes) { c.supertypes.map { (p, dris) -> - list(dris, prefix = " extends ", platformData = setOf(p)) { - link(it.sureClassNames, it, platformData = setOf(p)) + list(dris, prefix = " extends ", sourceSets = setOf(p)) { + link(it.sureClassNames, it, sourceSets = setOf(p)) } } } diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index dca97ec6..607a58a7 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -65,6 +65,12 @@ class Arguments(val parser: DokkaArgumentsParser) : DokkaConfiguration.PassConfi "" ) + override val sourceSetName: String by parser.stringOption( + listOf("-module"), + "Name of the source set", + "main" + ) + override val classpath: List<String> by parser.repeatableOption( listOf("-classpath"), "Classpath for symbol resolution" @@ -75,6 +81,11 @@ class Arguments(val parser: DokkaArgumentsParser) : DokkaConfiguration.PassConfi "Source file or directory (allows many paths separated by the system path separator)" ) { SourceRootImpl(it) } + override val dependentSourceRoots: List<DokkaConfiguration.SourceRoot> by parser.repeatableOption( + listOf("-src"), + "Source file or directory (allows many paths separated by the system path separator)" + ) { SourceRootImpl(it) } + override val samples: List<String> by parser.repeatableOption( listOf("-sample"), "Source root for samples" diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt index 24bcd96d..393a3077 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/ConfigurationExtractor.kt @@ -13,72 +13,58 @@ import org.gradle.api.plugins.JavaPluginConvention import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.compile.AbstractCompile import org.jetbrains.dokka.ReflectDsl +import org.jetbrains.kotlin.gradle.dsl.KotlinCommonOptions import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension +import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension import org.jetbrains.kotlin.gradle.dsl.KotlinSingleTargetExtension -import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation -import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType -import org.jetbrains.kotlin.gradle.plugin.KotlinTarget +import org.jetbrains.kotlin.gradle.plugin.* import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File import java.io.Serializable class ConfigurationExtractor(private val project: Project) { - fun extractConfiguration(targetName: String, variantName: String?) = if (project.isMultiplatformProject()) { - extractFromMultiPlatform(targetName, variantName) - } else { - extractFromSinglePlatform(variantName) - } - - fun extractFromSinglePlatform(variantName: String? = null): PlatformData? { - val target: KotlinTarget - try { - target = project.extensions.getByType(KotlinSingleTargetExtension::class.java).target - } catch (e: Throwable) { - when (e){ - is UnknownDomainObjectException, is NoClassDefFoundError, is ClassNotFoundException -> - return null - else -> throw e + fun extractConfiguration(targetName: String, variantName: String?) = + extractFromKotlinProject(targetName, variantName) + + fun extractFromKotlinProject(sourceSetName: String, variantName: String?): PlatformData? { + val projectExtension = project.extensions.getByType(KotlinProjectExtension::class.java) + val sourceSet = projectExtension.sourceSets.findByName(sourceSetName) + ?: run { project.logger.error("No source set with name '$sourceSetName' found"); return null } + val compilation = when (projectExtension) { + is KotlinMultiplatformExtension -> projectExtension.targets.flatMap { it.compilations } + .first { it.kotlinSourceSets.contains(sourceSet) } + is KotlinSingleTargetExtension -> projectExtension.target.compilations.find { + it.kotlinSourceSets.contains( + sourceSet + ) } - } - - return try { - PlatformData(null, getClasspath(target, variantName), getSourceSet(target, variantName), getPlatformName(target.platformType)) - } catch(e: NoSuchMethodError){ - null - } + else -> null + } ?: run { project.logger.error("No compilation found for set with name '$sourceSetName'"); return null } + + val classpath = compilation.compileDependencyFiles.files.filter { it.exists() } + val dependencies = (compilation.allKotlinSourceSets - sourceSet).flatMap { it.kotlin.sourceDirectories } + return PlatformData( + sourceSetName, + classpath, + sourceSet.kotlin.sourceDirectories.filter { it.exists() }.toList(), + dependencies, + compilation.target.targetName + ) } - private fun extractFromMultiPlatform(targetName: String, variantName: String?): PlatformData? = - try { - project.extensions.getByType(KotlinMultiplatformExtension::class.java).targets - } catch (e: Throwable) { - when (e){ - is UnknownDomainObjectException, is NoClassDefFoundError, is ClassNotFoundException -> - null - else -> throw e - } - }?.let { - val fixedName = if(targetName.toLowerCase() == "common") "metadata" else targetName.toLowerCase() - it.find { target -> target.name.toLowerCase() == fixedName }?.let { target -> - PlatformData(fixedName, getClasspath(target, variantName), getSourceSet(target, variantName), target.platformType.toString()) - } - } - fun extractFromJavaPlugin(): PlatformData? = project.convention.findPlugin(JavaPluginConvention::class.java) ?.run { sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME)?.allSource?.srcDirs } - ?.let { PlatformData(null, emptyList(), it.toList(), "") } + ?.let { PlatformData(null, emptyList(), it.toList(), emptyList(), "") } - fun extractFromKotlinTasks(kotlinTasks: List<Task>): PlatformData? = + fun extractFromKotlinTasks(passName: String, kotlinTasks: List<Task>): PlatformData? = try { - kotlinTasks.map { extractFromKotlinTask(it) }.let { platformDataList -> - PlatformData(null, platformDataList.flatMap { it.classpath }, platformDataList.flatMap { it.sourceRoots }, "") - } + kotlinTasks.find { it.toString() == passName }?.let { extractFromKotlinTask(it) } } catch (e: Throwable) { - when (e){ + when (e) { is UnknownDomainObjectException, is NoClassDefFoundError, is ClassNotFoundException -> - extractFromKotlinTasksTheHardWay(kotlinTasks) + extractFromKotlinTasksTheHardWay(passName, kotlinTasks) else -> throw e } } @@ -89,15 +75,23 @@ class ConfigurationExtractor(private val project: Project) { .compilations .find { it.compileKotlinTask == task } } catch (e: Throwable) { - when (e){ + when (e) { is UnknownDomainObjectException, is NoClassDefFoundError, is ClassNotFoundException -> project.extensions.getByType(KotlinMultiplatformExtension::class.java).targets .flatMap { it.compilations }.firstOrNull { it.compileKotlinTask == task } else -> throw e } - }.let { PlatformData(task.name, getClasspath(it), getSourceSet(it), it?.platformType?.toString() ?: "") } + }.let { + PlatformData( + task.name, + getClasspath(it), + getSourceSet(it), + getDependentSourceSet(it), + it?.platformType?.toString() ?: "" + ) + } - private fun extractFromKotlinTasksTheHardWay(kotlinTasks: List<Task>): PlatformData? { + private fun extractFromKotlinTasksTheHardWay(passName: String, kotlinTasks: List<Task>): PlatformData? { val allClasspath = mutableSetOf<File>() var allClasspathFileCollection: FileCollection = project.files() val allSourceRoots = mutableSetOf<File>() @@ -116,8 +110,8 @@ class ConfigurationExtractor(private val project: Project) { val taskClasspath: Iterable<File> = (it["getClasspath", AbstractCompile::class].takeIfIsFunc()?.invoke() - ?: it["compileClasspath", abstractKotlinCompileClz].takeIfIsProp()?.v() - ?: it["getClasspath", abstractKotlinCompileClz]()) + ?: it["compileClasspath", abstractKotlinCompileClz].takeIfIsProp()?.v() + ?: it["getClasspath", abstractKotlinCompileClz]()) if (taskClasspath is FileCollection) { allClasspathFileCollection += taskClasspath @@ -132,28 +126,35 @@ class ConfigurationExtractor(private val project: Project) { } catch (e: ResolveException) { mutableListOf() } - classpath.addAll (project.files(allClasspath).toList()) + classpath.addAll(project.files(allClasspath).toList()) - return PlatformData(null, classpath, allSourceRoots.toList(), "") + return PlatformData(null, classpath, allSourceRoots.toList(), emptyList(), "") } private fun getSourceSet(target: KotlinTarget, variantName: String? = null): List<File> = - if(variantName != null) + if (variantName != null) getSourceSet(getCompilation(target, variantName)) else getSourceSet(getMainCompilation(target)) - private fun getClasspath(target: KotlinTarget, variantName: String? = null): List<File> = if (target.isAndroidTarget()) { - if(variantName != null) - getClasspathFromAndroidTask(getCompilation(target, variantName)) - else - getClasspathFromAndroidTask(getMainCompilation(target)) - } else { - getClasspath(getMainCompilation(target)) - } + private fun getClasspath(target: KotlinTarget, variantName: String? = null): List<File> = + if (target.isAndroidTarget()) { + if (variantName != null) + getClasspathFromAndroidTask(getCompilation(target, variantName)) + else + getClasspathFromAndroidTask(getMainCompilation(target)) + } else { + getClasspath(getMainCompilation(target)) + } private fun getSourceSet(compilation: KotlinCompilation<*>?): List<File> = compilation - ?.allKotlinSourceSets + ?.kotlinSourceSets + ?.flatMap { it.kotlin.sourceDirectories } + ?.filter { it.exists() } + .orEmpty() + + private fun getDependentSourceSet(compilation: KotlinCompilation<*>?): List<File> = compilation + ?.let { it.allKotlinSourceSets - it.kotlinSourceSets } ?.flatMap { it.kotlin.sourceDirectories } ?.filter { it.exists() } .orEmpty() @@ -183,7 +184,7 @@ class ConfigurationExtractor(private val project: Project) { private fun getVariants(project: Project): Set<BaseVariant> { val androidExtension = project.extensions.getByName("android") - val baseVariants = when (androidExtension) { + val baseVariants = when (androidExtension) { is AppExtension -> androidExtension.applicationVariants.toSet() is LibraryExtension -> { androidExtension.libraryVariants.toSet() + @@ -208,8 +209,11 @@ class ConfigurationExtractor(private val project: Project) { private fun getPlatformName(platform: KotlinPlatformType): String = if (platform == KotlinPlatformType.androidJvm) KotlinPlatformType.jvm.toString() else platform.toString() - data class PlatformData(val name: String?, - val classpath: List<File>, - val sourceRoots: List<File>, - val platform: String) : Serializable + data class PlatformData( + val name: String?, + val classpath: List<File>, + val sourceRoots: List<File>, + val dependentSourceRoots: List<File>, + val platform: String + ) : Serializable }
\ No newline at end of file diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index 2018d3af..356661da 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka.gradle -import com.google.gson.Gson import com.google.gson.GsonBuilder import org.gradle.api.* import org.gradle.api.artifacts.Configuration @@ -24,7 +23,7 @@ import java.util.function.BiConsumer open class DokkaTask : DefaultTask(), Configurable { private val ANDROID_REFERENCE_URL = Builder("https://developer.android.com/reference/").build() - private val GLOBAL_PLATFORM_NAME = "global" // Used for copying perPackageOptions to other platforms + private val GLOBAL_CONFIGURATION_NAME = "global" // Used for copying perPackageOptions to other platforms @Suppress("MemberVisibilityCanBePrivate") fun defaultKotlinTasks(): List<Task> = with(ReflectDsl) { @@ -69,10 +68,10 @@ open class DokkaTask : DefaultTask(), Configurable { @Classpath lateinit var pluginsConfig: Configuration - var multiplatform: NamedDomainObjectContainer<GradlePassConfigurationImpl> + var dokkaSourceSets: NamedDomainObjectContainer<GradlePassConfigurationImpl> @Suppress("UNCHECKED_CAST") - @Nested get() = (DslObject(this).extensions.getByName(MULTIPLATFORM_EXTENSION_NAME) as NamedDomainObjectContainer<GradlePassConfigurationImpl>) - internal set(value) = DslObject(this).extensions.add(MULTIPLATFORM_EXTENSION_NAME, value) + @Nested get() = (DslObject(this).extensions.getByName(SOURCE_SETS_EXTENSION_NAME) as NamedDomainObjectContainer<GradlePassConfigurationImpl>) + internal set(value) = DslObject(this).extensions.add(SOURCE_SETS_EXTENSION_NAME, value) var configuration: GradlePassConfigurationImpl @Suppress("UNCHECKED_CAST") @@ -188,7 +187,7 @@ open class DokkaTask : DefaultTask(), Configurable { } internal fun getConfiguration(): GradleDokkaConfigurationImpl { - val globalConfig = multiplatform.toList().find { it.name.toLowerCase() == GLOBAL_PLATFORM_NAME } + val globalConfig = dokkaSourceSets.toList().find { it.name.toLowerCase() == GLOBAL_CONFIGURATION_NAME } val defaultModulesConfiguration = collectConfigurations() .map { defaultPassConfiguration(it, globalConfig) } return GradleDokkaConfigurationImpl().apply { @@ -204,27 +203,28 @@ open class DokkaTask : DefaultTask(), Configurable { } private fun collectConfigurations() = - if (this.isMultiplatformProject()) collectMultiplatform() else listOf(collectSinglePlatform(configuration)) + if (this.dokkaSourceSets.isNotEmpty()) collectMultipassConfiguration() else listOf(collectSinglePassConfiguration(configuration)) - private fun collectMultiplatform() = multiplatform - .filterNot { it.name.toLowerCase() == GLOBAL_PLATFORM_NAME } - .map { collectSinglePlatform(it) } + private fun collectMultipassConfiguration() = dokkaSourceSets + .filterNot { it.name.toLowerCase() == GLOBAL_CONFIGURATION_NAME } + .map { collectSinglePassConfiguration(it) } - private fun collectSinglePlatform(config: GradlePassConfigurationImpl): GradlePassConfigurationImpl { - val userConfig = config.let { + private fun collectSinglePassConfiguration(config: GradlePassConfigurationImpl): GradlePassConfigurationImpl { + val userConfig = config + /*.let { if (it.collectKotlinTasks != null) { configExtractor.extractFromKotlinTasks(extractKotlinCompileTasks(it.collectKotlinTasks!!)) ?.let { platformData -> mergeUserConfigurationAndPlatformData(it, platformData) } ?: it } else { it } - } + }*/ if (disableAutoconfiguration) return userConfig val baseConfig = configExtractor.extractConfiguration(userConfig.name, userConfig.androidVariant) ?.let { mergeUserConfigurationAndPlatformData(userConfig, it) } - ?: if (this.isMultiplatformProject()) { + ?: if (this.dokkaSourceSets.isNotEmpty()) { if (outputDiagnosticInfo) logger.warn( "Could not find target with name: ${userConfig.name} in Kotlin Gradle Plugin, " + @@ -233,7 +233,7 @@ open class DokkaTask : DefaultTask(), Configurable { userConfig } else { logger.warn("Could not find target with name: ${userConfig.name} in Kotlin Gradle Plugin") - collectFromSinglePlatformOldPlugin() + collectFromSinglePlatformOldPlugin(userConfig.name) } return if (subProjects.isNotEmpty()) { @@ -256,8 +256,8 @@ open class DokkaTask : DefaultTask(), Configurable { } } - private fun collectFromSinglePlatformOldPlugin() = - configExtractor.extractFromKotlinTasks(kotlinTasks) + private fun collectFromSinglePlatformOldPlugin(name: String) = + configExtractor.extractFromKotlinTasks(name, kotlinTasks) ?.let { mergeUserConfigurationAndPlatformData(configuration, it) } ?: configExtractor.extractFromJavaPlugin() ?.let { mergeUserConfigurationAndPlatformData(configuration, it) } @@ -269,6 +269,7 @@ open class DokkaTask : DefaultTask(), Configurable { ) = userConfig.copy().apply { sourceRoots.addAll(userConfig.sourceRoots.union(autoConfig.sourceRoots.toSourceRoots()).distinct()) + dependentSourceRoots.addAll(userConfig.dependentSourceRoots.union(autoConfig.dependentSourceRoots.toSourceRoots()).distinct()) classpath = userConfig.classpath.union(autoConfig.classpath.map { it.absolutePath }).distinct() if (userConfig.platform == null && autoConfig.platform != "") platform = autoConfig.platform @@ -281,11 +282,10 @@ open class DokkaTask : DefaultTask(), Configurable { if (config.moduleName == "") { config.moduleName = project.name } - if (config.targets.isEmpty() && multiplatform.isNotEmpty()) { - config.targets = listOf(config.name) + if (config.sourceSetName.isEmpty()) { + config.sourceSetName = config.platform ?: config.name } - config.classpath = - (config.classpath as List<Any>).map { it.toString() }.distinct() // Workaround for Groovy's GStringImpl + config.classpath = (config.classpath as List<Any>).map { it.toString() }.distinct() // Workaround for Groovy's GStringImpl config.sourceRoots = config.sourceRoots.distinct().toMutableList() config.samples = config.samples.map { project.file(it).absolutePath } config.includes = config.includes.map { project.file(it).absolutePath } @@ -293,7 +293,7 @@ open class DokkaTask : DefaultTask(), Configurable { if (project.isAndroidProject() && !config.noAndroidSdkLink) { // TODO: introduce Android as a separate Dokka platform? config.externalDocumentationLinks.add(ANDROID_REFERENCE_URL) } - if (config.platform != null && config.platform.toString().isNotEmpty()) { + if (config.platform != null && config.platform.toString().isNotBlank()) { config.analysisPlatform = dokkaPlatformFromString(config.platform.toString()) } if (globalConfig != null) { @@ -339,5 +339,4 @@ open class DokkaTask : DefaultTask(), Configurable { null } } -} - +}
\ No newline at end of file diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt index 570da5f3..9719686e 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/configurationImplementations.kt @@ -27,7 +27,9 @@ class GradleSourceRootImpl: SourceRoot, Serializable { open class GradlePassConfigurationImpl(@Transient val name: String = ""): PassConfiguration { @Input @Optional override var classpath: List<String> = emptyList() @Input override var moduleName: String = "" + @Input override var sourceSetName: String = "" @Input override var sourceRoots: MutableList<SourceRoot> = mutableListOf() + @Input override var dependentSourceRoots: MutableList<SourceRoot> = mutableListOf() @Input override var samples: List<String> = emptyList() @Input override var includes: List<String> = emptyList() @Input override var includeNonPublic: Boolean = false diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt index 1d93a310..fea0d864 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt @@ -9,7 +9,7 @@ import java.io.InputStream import java.util.* internal const val CONFIGURATION_EXTENSION_NAME = "configuration" -internal const val MULTIPLATFORM_EXTENSION_NAME = "multiplatform" +internal const val SOURCE_SETS_EXTENSION_NAME = "dokkaSourceSets" internal const val DOKKA_TASK_NAME = "dokka" internal const val DOKKA_COLLECTOR_TASK_NAME = "dokkaCollector" @@ -45,7 +45,7 @@ open class DokkaPlugin : Plugin<Project> { project.tasks.create(DOKKA_TASK_NAME, taskClass) } project.tasks.withType(taskClass) { task -> - task.multiplatform = project.container(GradlePassConfigurationImpl::class.java) + task.dokkaSourceSets = project.container(GradlePassConfigurationImpl::class.java) task.configuration = GradlePassConfigurationImpl() task.dokkaRuntime = runtimeConfiguration task.pluginsConfig = pluginsConfiguration diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt index 31892e8e..3369a640 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt @@ -16,16 +16,4 @@ fun Project.isAndroidProject() = try { false } -fun Project.isMultiplatformProject() = try { - project.extensions.getByType(KotlinMultiplatformExtension::class.java) - true -} catch(e: UnknownDomainObjectException) { - false -} catch (e: NoClassDefFoundError){ - false -} catch(e: ClassNotFoundException) { - false -} - -fun KotlinTarget.isAndroidTarget() = this.platformType == KotlinPlatformType.androidJvm -fun DokkaTask.isMultiplatformProject() = this.multiplatform.isNotEmpty()
\ No newline at end of file +fun KotlinTarget.isAndroidTarget() = this.platformType == KotlinPlatformType.androidJvm
\ No newline at end of file diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 24d95ab4..ac22eb57 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -83,6 +83,9 @@ abstract class AbstractDokkaMojo : AbstractMojo() { override var suppress: Boolean = false } + @Parameter(required = true, defaultValue = "\${project.sourceSet}") + var sourceSetName: String = "" + @Parameter(required = true, defaultValue = "\${project.compileSourceRoots}") var sourceDirectories: List<String> = emptyList() @@ -201,7 +204,9 @@ abstract class AbstractDokkaMojo : AbstractMojo() { val passConfiguration = PassConfigurationImpl( classpath = classpath, - sourceRoots = sourceDirectories.map { SourceRootImpl(it) } + sourceRoots.map { SourceRootImpl(path = it.path) }, + sourceSetName = sourceSetName, + sourceRoots = sourceDirectories.map { SourceRootImpl(it) }, + dependentSourceRoots = sourceRoots.map { SourceRootImpl(path = it.path) }, samples = samples, includes = includes, collectInheritedExtensionsFromLibraries = collectInheritedExtensionsFromLibraries, // TODO: Should we implement this? diff --git a/testApi/src/main/kotlin/testApi/context/MockContext.kt b/testApi/src/main/kotlin/testApi/context/MockContext.kt index 5236f1f4..11520280 100644 --- a/testApi/src/main/kotlin/testApi/context/MockContext.kt +++ b/testApi/src/main/kotlin/testApi/context/MockContext.kt @@ -2,7 +2,8 @@ package org.jetbrains.dokka.testApi.context import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.EnvironmentAndFacade -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.plugability.ExtensionPoint @@ -15,8 +16,9 @@ import kotlin.reflect.full.memberProperties class MockContext( vararg extensions: Pair<ExtensionPoint<*>, (DokkaContext) -> Any>, private val testConfiguration: DokkaConfiguration? = null, - private val testPlatforms: Map<PlatformData, EnvironmentAndFacade>? = null, - private val unusedExtensionPoints: List<ExtensionPoint<*>>? = null + private val testSourceSets: Map<SourceSetData, EnvironmentAndFacade>? = null, + private val unusedExtensionPoints: List<ExtensionPoint<*>>? = null, + override val sourceSetCache: SourceSetCache ) : DokkaContext { private val extensionMap by lazy { extensions.groupBy(Pair<ExtensionPoint<*>, (DokkaContext) -> Any>::first) { @@ -39,8 +41,8 @@ class MockContext( override val configuration: DokkaConfiguration get() = testConfiguration ?: throw IllegalStateException("This mock context doesn't provide configuration") - override val platforms: Map<PlatformData, EnvironmentAndFacade> - get() = testPlatforms ?: throw IllegalStateException("This mock context doesn't provide platforms data") + override val platforms: Map<SourceSetData, EnvironmentAndFacade> + get() = testSourceSets ?: throw IllegalStateException("This mock context doesn't provide platforms data") override val unusedPoints: Collection<ExtensionPoint<*>> get() = unusedExtensionPoints ?: throw IllegalStateException("This mock context doesn't provide unused extension points") diff --git a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt index 0e77344d..802bfd93 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/DokkaTestGenerator.kt @@ -3,7 +3,8 @@ package org.jetbrains.dokka.testApi.testRunner import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.DokkaGenerator import org.jetbrains.dokka.EnvironmentAndFacade -import org.jetbrains.dokka.pages.PlatformData +import org.jetbrains.dokka.model.SourceSetCache +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.plugability.DokkaPlugin import org.jetbrains.dokka.utilities.DokkaLogger @@ -16,11 +17,15 @@ internal class DokkaTestGenerator( fun generate() = with(testMethods) { val dokkaGenerator = DokkaGenerator(configuration, logger) + val sourceSetsCache = SourceSetCache() - val platforms: Map<PlatformData, EnvironmentAndFacade> = dokkaGenerator.setUpAnalysis(configuration) + val platforms: Map<SourceSetData, EnvironmentAndFacade> = dokkaGenerator.setUpAnalysis( + configuration, + sourceSetsCache + ) analysisSetupStage(platforms) - val context = dokkaGenerator.initializePlugins(configuration, logger, platforms, pluginOverrides) + val context = dokkaGenerator.initializePlugins(configuration, logger, platforms, sourceSetsCache, pluginOverrides) pluginsSetupStage(context) val modulesFromPlatforms = dokkaGenerator.createDocumentationModels(platforms, context) diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 6c132d3c..43d99dad 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -3,8 +3,8 @@ package org.jetbrains.dokka.testApi.testRunner import com.intellij.openapi.application.PathManager import org.jetbrains.dokka.* import org.jetbrains.dokka.model.DModule +import org.jetbrains.dokka.model.SourceSetData import org.jetbrains.dokka.pages.ModulePageNode -import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.pages.RootPageNode import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.DokkaPlugin @@ -104,7 +104,7 @@ abstract class AbstractCoreTest { } protected class TestBuilder { - var analysisSetupStage: (Map<PlatformData, EnvironmentAndFacade>) -> Unit = {} + var analysisSetupStage: (Map<SourceSetData, EnvironmentAndFacade>) -> Unit = {} var pluginsSetupStage: (DokkaContext) -> Unit = {} var documentablesCreationStage: (List<DModule>) -> Unit = {} var documentablesFirstTransformationStep: (List<DModule>) -> Unit = {} @@ -167,8 +167,10 @@ abstract class AbstractCoreTest { @DokkaConfigurationDsl protected class DokkaPassConfigurationBuilder( var moduleName: String = "root", + var sourceSetName: String = "main", var classpath: List<String> = emptyList(), var sourceRoots: List<String> = emptyList(), + var dependentSourceRoots: List<String> = emptyList(), var samples: List<String> = emptyList(), var includes: List<String> = emptyList(), var includeNonPublic: Boolean = true, @@ -192,8 +194,10 @@ abstract class AbstractCoreTest { ) { fun build() = PassConfigurationImpl( moduleName = moduleName, + sourceSetName = sourceSetName, classpath = classpath, sourceRoots = sourceRoots.map { SourceRootImpl(it) }, + dependentSourceRoots = dependentSourceRoots.map { SourceRootImpl(it) }, samples = samples, includes = includes, includeNonPublic = includeNonPublic, @@ -235,7 +239,7 @@ abstract class AbstractCoreTest { } data class TestMethods( - val analysisSetupStage: (Map<PlatformData, EnvironmentAndFacade>) -> Unit, + val analysisSetupStage: (Map<SourceSetData, EnvironmentAndFacade>) -> Unit, val pluginsSetupStage: (DokkaContext) -> Unit, val documentablesCreationStage: (List<DModule>) -> Unit, val documentablesFirstTransformationStep: (List<DModule>) -> Unit, |