aboutsummaryrefslogtreecommitdiff
path: root/plugins/all-modules-page/src/main/kotlin
diff options
context:
space:
mode:
authorKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2021-07-05 14:10:23 +0200
committerGitHub <noreply@github.com>2021-07-05 14:10:23 +0200
commit0bf1d0f5491a62c56393a06cdfb4168778d9829e (patch)
tree808f631e72b652dc2c3d5929f85f677968bc56f6 /plugins/all-modules-page/src/main/kotlin
parenta1d44ab80df217196fe5ee9455c7cf1c135e3b07 (diff)
downloaddokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.gz
dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.tar.bz2
dokka-0bf1d0f5491a62c56393a06cdfb4168778d9829e.zip
Flatten multi-module structure (#1980)
* Add support for multimodule package lists * Merge package-lists in multi-module generation * Remove double-wrapping of modules in multi-module generation * Handle empty modules in package lists
Diffstat (limited to 'plugins/all-modules-page/src/main/kotlin')
-rw-r--r--plugins/all-modules-page/src/main/kotlin/AllModulesPagePlugin.kt2
-rw-r--r--plugins/all-modules-page/src/main/kotlin/ExternalModuleLinkResolver.kt10
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/all-modules-page/src/main/kotlin/AllModulesPagePlugin.kt b/plugins/all-modules-page/src/main/kotlin/AllModulesPagePlugin.kt
index e6556b07..da44c840 100644
--- a/plugins/all-modules-page/src/main/kotlin/AllModulesPagePlugin.kt
+++ b/plugins/all-modules-page/src/main/kotlin/AllModulesPagePlugin.kt
@@ -45,4 +45,4 @@ class AllModulesPagePlugin : DokkaPlugin() {
val multiModuleLinkResolver by extending {
externalModuleLinkResolver providing ::DefaultExternalModuleLinkResolver
}
-} \ No newline at end of file
+}
diff --git a/plugins/all-modules-page/src/main/kotlin/ExternalModuleLinkResolver.kt b/plugins/all-modules-page/src/main/kotlin/ExternalModuleLinkResolver.kt
index 0fde629c..e7925ead 100644
--- a/plugins/all-modules-page/src/main/kotlin/ExternalModuleLinkResolver.kt
+++ b/plugins/all-modules-page/src/main/kotlin/ExternalModuleLinkResolver.kt
@@ -1,10 +1,10 @@
package org.jetbrains.dokka.allModulesPage
-import org.jetbrains.dokka.DokkaConfiguration
+import org.jetbrains.dokka.DokkaConfiguration.DokkaModuleDescription
import org.jetbrains.dokka.base.DokkaBase
-import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider.Companion.identifierToFilename
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
+import org.jetbrains.dokka.base.resolvers.shared.PackageList.Companion.PACKAGE_LIST_NAME
import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.plugability.DokkaContext
@@ -42,10 +42,10 @@ class DefaultExternalModuleLinkResolver(val context: DokkaContext) : ExternalMod
this
}
- private fun loadPackageListForModule(module: DokkaConfiguration.DokkaModuleDescription) =
- module.sourceOutputDirectory.resolve(File(identifierToFilename(module.name))).let {
+ private fun loadPackageListForModule(module: DokkaModuleDescription) =
+ module.sourceOutputDirectory.walkTopDown().maxDepth(3).firstOrNull { it.name == PACKAGE_LIST_NAME }?.let {
PackageList.load(
- URL("file:" + it.resolve("package-list").path),
+ URL("file:" + it.path),
8,
true
)