diff options
Diffstat (limited to 'plugins/all-modules-page')
6 files changed, 19 insertions, 19 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 ) diff --git a/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt index 11a03bc4..57f7027f 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/MultiModuleDocumentationTest.kt @@ -62,4 +62,4 @@ class MultiModuleDocumentationTest : MultiModuleAbstractTest() { } } } -}
\ No newline at end of file +} diff --git a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt index 2637714f..b7487c16 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt @@ -50,7 +50,7 @@ class ResolveLinkCommandResolutionTest : MultiModuleAbstractTest() { } val expected = createHTML().a { - href = "../../module2/package2/-sample/index.html" + href = "../module2/package2/-sample/index.html" span { +"Sample" } @@ -97,12 +97,12 @@ class ResolveLinkCommandResolutionTest : MultiModuleAbstractTest() { fun setup(content: String): File { folder.create() - val innerModule1 = folder.newFolder("module1", "module1") - val innerModule2 = folder.newFolder("module2", "module2") + val innerModule1 = folder.newFolder("module1") + val innerModule2 = folder.newFolder("module2") val packageList = innerModule2.resolve("package-list") packageList.writeText(mockedPackageListForPackages(RecognizedLinkFormat.DokkaHtml, "package2")) val contentFile = innerModule1.resolve("index.html") contentFile.writeText(content) return contentFile } -}
\ No newline at end of file +} diff --git a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt index 185a179d..975d3183 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt @@ -33,7 +33,7 @@ class ResolveLinkGfmCommandResolutionTest : MultiModuleAbstractTest() { sourceOutputDirectory = folder.root.resolve("module2"), ) ) - this.outputDir = folder.root + outputDir = folder.root } @Test @@ -49,7 +49,7 @@ class ResolveLinkGfmCommandResolutionTest : MultiModuleAbstractTest() { } }.toString() - val expected = "[Sample text inside](../../module2/package2/-sample/index.md)" + val expected = "[Sample text inside](../module2/package2/-sample/index.md)" val content = setup(link) val configuration = configuration() @@ -63,8 +63,8 @@ class ResolveLinkGfmCommandResolutionTest : MultiModuleAbstractTest() { private fun setup(content: String): File { folder.create() - val innerModule1 = folder.newFolder("module1", "module1") - val innerModule2 = folder.newFolder("module2", "module2") + val innerModule1 = folder.newFolder( "module1") + val innerModule2 = folder.newFolder( "module2") val packageList = innerModule2.resolve("package-list") packageList.writeText(mockedPackageListForPackages(RecognizedLinkFormat.DokkaGFM, "package2")) val contentFile = innerModule1.resolve("index.md") diff --git a/plugins/all-modules-page/src/test/kotlin/templates/mockedPackageListFactory.kt b/plugins/all-modules-page/src/test/kotlin/templates/mockedPackageListFactory.kt index 7a10041b..3386ae2c 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/mockedPackageListFactory.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/mockedPackageListFactory.kt @@ -1,12 +1,12 @@ package org.jetbrains.dokka.allModulesPage.templates -import org.jetbrains.dokka.base.renderers.PackageListService +import org.jetbrains.dokka.base.resolvers.shared.PackageList import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat internal fun mockedPackageListForPackages(format: RecognizedLinkFormat, vararg packages: String): String = """ - ${PackageListService.DOKKA_PARAM_PREFIX}.format:${format.formatName} - ${PackageListService.DOKKA_PARAM_PREFIX}.linkExtension:${format.linkExtension} + ${PackageList.DOKKA_PARAM_PREFIX}.format:${format.formatName} + ${PackageList.DOKKA_PARAM_PREFIX}.linkExtension:${format.linkExtension} ${packages.sorted().joinToString(separator = "\n", postfix = "\n") { it }} - """.trimIndent()
\ No newline at end of file + """.trimIndent() |