diff options
author | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2021-07-05 14:10:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-05 14:10:23 +0200 |
commit | 0bf1d0f5491a62c56393a06cdfb4168778d9829e (patch) | |
tree | 808f631e72b652dc2c3d5929f85f677968bc56f6 /plugins/all-modules-page/src/test/kotlin/templates | |
parent | a1d44ab80df217196fe5ee9455c7cf1c135e3b07 (diff) | |
download | dokka-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/test/kotlin/templates')
4 files changed, 13 insertions, 13 deletions
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() |