diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 9a1ff602d38..b53fd1eef3e 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -61,6 +61,14 @@ fun Iterable>.build(): List = this.map data class DokkaSourceSetID( + /** + * Unique identifier of the scope that this source set is placed in. + * Each scope provide only unique source set names. + * + * E.g. One DokkaTask inside the Gradle plugin represents one source set scope, since there cannot be multiple + * source sets with the same name. However, a Gradle project will not be a proper scope, since there can be + * multple DokkaTasks that contain source sets with the same name (but different configuration) + */ val scopeId: String, val sourceSetName: String ) : Serializable { @@ -116,8 +124,8 @@ interface DokkaConfiguration : Serializable { interface DokkaModuleDescription : Serializable { val name: String - val path: File - val docFile: File + val relativePathToOutputDirectory: File + val includes: Set } interface PackageOptions : Serializable { diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index 3fcc7aacd15..5b32ebae1f0 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -43,8 +43,8 @@ data class DokkaSourceSetImpl( data class DokkaModuleDescriptionImpl( override val name: String, - override val path: File, - override val docFile: File + override val relativePathToOutputDirectory: File, + override val includes: Set ) : DokkaConfiguration.DokkaModuleDescription data class SourceLinkDefinitionImpl( diff --git a/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt b/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt index f6cb99db4e4..2d9f99b2293 100644 --- a/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt +++ b/core/test-api/src/main/kotlin/testApi/testRunner/TestDokkaConfigurationBuilder.kt @@ -138,7 +138,6 @@ val defaultSourceSet = DokkaSourceSetImpl( analysisPlatform = Platform.DEFAULT ) -// TODO NOW: Clean up fun sourceSet(name: String): DokkaConfiguration.DokkaSourceSet { return defaultSourceSet.copy( displayName = name, diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/Module.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/Module.md new file mode 100644 index 00000000000..0570f467496 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/Module.md @@ -0,0 +1,6 @@ +# Module !Module B! +Here is some description for Module B + +Module B: Second paragraph +# Module moduleB +§IGNORED$This documentation shall be ignored, because wrong module name§IGNORED$ diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md deleted file mode 100644 index f8c52880a7c..00000000000 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Module moduleB -Here is some description for module B diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts index 9492fdc8cac..5f0b69c72d8 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.dokka.gradle.DokkaTask + plugins { kotlin("jvm") id("org.jetbrains.dokka") @@ -6,3 +8,10 @@ plugins { dependencies { implementation(kotlin("stdlib")) } + +tasks.withType().configureEach { + moduleName.set("!Module B!") + dokkaSourceSets.configureEach { + includes.from("Module.md") + } +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/Module.md similarity index 100% rename from integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md rename to integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/Module.md diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts index 9492fdc8cac..e471d375045 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jetbrains.dokka.gradle.DokkaTask + plugins { kotlin("jvm") id("org.jetbrains.dokka") @@ -6,3 +8,9 @@ plugins { dependencies { implementation(kotlin("stdlib")) } + +tasks.withType().configureEach { + dokkaSourceSets.configureEach { + includes.from("Module.md") + } +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/build.gradle.kts new file mode 100644 index 00000000000..a16e038f2bf --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/build.gradle.kts @@ -0,0 +1,10 @@ +import org.jetbrains.dokka.gradle.DokkaTask + +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +dependencies { + implementation(kotlin("stdlib")) +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt new file mode 100644 index 00000000000..88174d5353b --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleD/src/main/kotlin/org/jetbrains/dokka/it/moduleD/ModuleC.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleD + +@Suppress("unused") +class ModuleD { + fun undocumentedPublicFunction() {} +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/settings.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/settings.gradle.kts index a5c89291aef..dda6558f477 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/settings.gradle.kts +++ b/integration-tests/gradle/projects/it-multimodule-0/settings.gradle.kts @@ -3,3 +3,4 @@ rootProject.name = "it-multimodule-0" include(":moduleA") include(":moduleA:moduleB") include(":moduleA:moduleC") +include(":moduleA:moduleD") diff --git a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt index 58140449980..68985c7bba4 100644 --- a/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt +++ b/plugins/base/src/main/kotlin/allModulePage/MultimodulePageCreator.kt @@ -1,8 +1,7 @@ package org.jetbrains.dokka.base.allModulePage -import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.DokkaConfiguration.DokkaModuleDescription import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.DokkaException import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.resolvers.local.MultimoduleLocationProvider.Companion.MULTIMODULE_PACKAGE_PLACEHOLDER import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter @@ -12,20 +11,24 @@ import org.jetbrains.dokka.model.doc.DocumentationNode import org.jetbrains.dokka.model.doc.P import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.base.parsers.MarkdownParser +import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentation.Classifier.Module +import org.jetbrains.dokka.base.parsers.moduleAndPackage.ModuleAndPackageDocumentationParsingContext +import org.jetbrains.dokka.base.parsers.moduleAndPackage.parseModuleAndPackageDocumentation +import org.jetbrains.dokka.base.parsers.moduleAndPackage.parseModuleAndPackageDocumentationFragments +import org.jetbrains.dokka.base.transformers.documentables.ModuleAndPackageDocumentationReader import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.querySingle import org.jetbrains.dokka.transformers.pages.PageCreator import org.jetbrains.dokka.utilities.DokkaLogger -class MultimodulePageCreator( - val context: DokkaContext +class MultimodulePageCreator ( + private val context: DokkaContext, ) : PageCreator { private val logger: DokkaLogger = context.logger override fun invoke(): RootPageNode { val parser = MarkdownParser(logger = logger) val modules = context.configuration.modules - modules.forEach(::throwOnMissingModuleDocFile) val commentsConverter = context.plugin(DokkaBase::class)?.querySingle { commentsToContentConverter } val signatureProvider = context.plugin(DokkaBase::class)?.querySingle { signatureProvider } @@ -41,21 +44,22 @@ class MultimodulePageCreator( ) { header(2, "All modules:") table(styles = setOf(MultimoduleTable)) { - modules.mapNotNull { module -> - val paragraph = module.docFile.readText().let { parser.parse(it).firstParagraph() } - paragraph?.let { - val dri = DRI(packageName = MULTIMODULE_PACKAGE_PLACEHOLDER, classNames = module.name) - val dci = DCI(setOf(dri), ContentKind.Main) - val header = - ContentHeader(listOf(linkNode(module.name, dri)), 2, dci, emptySet(), emptySet()) - val content = ContentGroup( - DocTagToContentConverter.buildContent(it, dci, emptySet()), - dci, - emptySet(), - emptySet() - ) - ContentGroup(listOf(header, content), dci, emptySet(), emptySet()) - } + modules.map { module -> + val displayedModuleDocumentation = getDisplayedModuleDocumentation(module) + val dri = DRI(packageName = MULTIMODULE_PACKAGE_PLACEHOLDER, classNames = module.name) + val dci = DCI(setOf(dri), ContentKind.Main) + val header = + ContentHeader(listOf(linkNode(module.name, dri)), 2, dci, emptySet(), emptySet()) + val content = ContentGroup( + children = + if (displayedModuleDocumentation != null) + DocTagToContentConverter.buildContent(displayedModuleDocumentation, dci, emptySet()) + else emptyList(), + dci = dci, + sourceSets = emptySet(), + style = emptySet() + ) + ContentGroup(listOf(header, content), dci, emptySet(), emptySet()) } } } @@ -66,12 +70,16 @@ class MultimodulePageCreator( ) } - private fun throwOnMissingModuleDocFile(module: DokkaConfiguration.DokkaModuleDescription) { - if (!module.docFile.exists() || !module.docFile.isFile) { - throw DokkaException( - "Missing documentation file for module ${module.name}: ${module.docFile.absolutePath}" - ) - } + private fun getDisplayedModuleDocumentation(module: DokkaModuleDescription): P? { + val parsingContext = ModuleAndPackageDocumentationParsingContext(logger) + return module.includes + .flatMap { include -> parseModuleAndPackageDocumentationFragments(include) } + .map { fragment -> parseModuleAndPackageDocumentation(parsingContext, fragment) } + .firstOrNull { documentation -> documentation.classifier == Module && documentation.name == module.name } + ?.documentation?.children.orEmpty() + .flatMap { it.root.children } + .filterIsInstance

() + .firstOrNull() } private fun DocumentationNode.firstParagraph() = diff --git a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt index 3e0122bf6a1..b5891dbf096 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/MultimoduleLocationProvider.kt @@ -12,7 +12,7 @@ class MultimoduleLocationProvider(private val root: RootPageNode, context: Dokka private val defaultLocationProvider = DokkaLocationProvider(root, context) val paths = context.configuration.modules.map { - it.name to it.path + it.name to it.relativePathToOutputDirectory }.toMap() override fun resolve(dri: DRI, sourceSets: Set, context: PageNode?) = diff --git a/plugins/base/src/test/kotlin/model/PackagesTest.kt b/plugins/base/src/test/kotlin/model/PackagesTest.kt index 1adf76268b6..3deb95e9907 100644 --- a/plugins/base/src/test/kotlin/model/PackagesTest.kt +++ b/plugins/base/src/test/kotlin/model/PackagesTest.kt @@ -117,8 +117,6 @@ class PackagesTest : AbstractModelTest("/src/main/kotlin/packages/Test.kt", "pac } } - // TODO NOW test displayName - // todo // @Test fun suppressAtPackageLevel() { // verifyModel( diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt index 82e2148f2ba..92560c94e70 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt @@ -3,8 +3,6 @@ package org.jetbrains.dokka.gradle import org.gradle.api.internal.tasks.TaskDependencyInternal import org.gradle.api.provider.Property import org.gradle.api.tasks.* -import org.jetbrains.dokka.DokkaConfiguration -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.DokkaModuleDescriptionImpl import org.jetbrains.dokka.DokkaMultimoduleBootstrapImpl @@ -14,25 +12,14 @@ import java.io.File @Deprecated("Use 'DokkaMultimoduleTask' instead", ReplaceWith("DokkaMultimoduleTask")) typealias DokkaMultimoduleTask = DokkaMultiModuleTask +private typealias TaskPath = String abstract class DokkaMultiModuleTask : AbstractDokkaParentTask(DokkaMultimoduleBootstrapImpl::class) { - /** - * Name of the file containing all necessary module information. - * This file has to be placed inside the subproject root directory. - */ - @Internal - val documentationFileName: Property = project.objects.safeProperty() - .safeConvention("README.md") - @Internal val fileLayout: Property = project.objects.safeProperty() .safeConvention(DokkaMultiModuleFileLayout.CompactInParent) - @get:InputFiles - internal val childDocumentationFiles: Iterable - get() = childDokkaTasks.map { task -> task.project.projectDir.resolve(documentationFileName.getSafe()) } - @get:InputFiles internal val sourceChildOutputDirectories: Iterable get() = childDokkaTasks.map { task -> task.outputDirectory.getSafe() } @@ -41,6 +28,12 @@ abstract class DokkaMultiModuleTask : AbstractDokkaParentTask(DokkaMultimoduleBo internal val targetChildOutputDirectories: Iterable get() = childDokkaTasks.map { task -> targetChildOutputDirectory(task) } + @get:Input + internal val childDokkaTaskIncludes: Map> + get() = childDokkaTasks.filterIsInstance().associate { task -> + task.path to task.dokkaSourceSets.flatMap { it.includes }.toSet() + } + @Internal override fun getTaskDependencies(): TaskDependencyInternal = super.getTaskDependencies() + childDokkaTasks @@ -62,9 +55,9 @@ abstract class DokkaMultiModuleTask : AbstractDokkaParentTask(DokkaMultimoduleBo pluginsClasspath = plugins.resolve().toList(), modules = childDokkaTasks.map { dokkaTask -> DokkaModuleDescriptionImpl( - name = dokkaTask.project.name, - path = targetChildOutputDirectory(dokkaTask).relativeTo(outputDirectory.getSafe()), - docFile = dokkaTask.project.projectDir.resolve(documentationFileName.get()).absoluteFile + name = dokkaTask.moduleName.getSafe(), + relativePathToOutputDirectory = targetChildOutputDirectory(dokkaTask).relativeTo(outputDirectory.getSafe()), + includes = childDokkaTaskIncludes[dokkaTask.path].orEmpty() ) } ) diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt index 5b9413c8c37..bea80f1efca 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt @@ -2,8 +2,7 @@ package org.jetbrains.dokka.gradle -import org.gradle.kotlin.dsl.create -import org.gradle.kotlin.dsl.withType +import org.gradle.kotlin.dsl.* import org.gradle.testfixtures.ProjectBuilder import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.DokkaException @@ -25,10 +24,14 @@ class DokkaMultiModuleTaskTest { .withProjectDir(rootProject.projectDir.resolve("child")) .withParent(rootProject).build() + private val childDokkaTask = childProject.tasks.create("childDokkaTask") + + private val multiModuleTask = rootProject.tasks.create("multiModuleTask").apply { + addChildTask(childDokkaTask) + } + init { rootProject.allprojects { project -> - project.plugins.apply("org.jetbrains.kotlin.jvm") - project.plugins.apply("org.jetbrains.dokka") project.tasks.withType().configureEach { task -> task.plugins.withDependencies { dependencies -> dependencies.clear() } } @@ -50,70 +53,66 @@ class DokkaMultiModuleTaskTest { @Test fun buildDokkaConfiguration() { - childProject.tasks.withType().configureEach { task -> - task.outputDirectory by task.project.buildDir.resolve("output") + val include1 = childDokkaTask.project.file("include1.md") + val include2 = childDokkaTask.project.file("include2.md") + + childDokkaTask.apply { + dokkaSourceSets.create("main") + dokkaSourceSets.create("test") + dokkaSourceSets.configureEach { + it.includes.from(include1, include2) + } } - val multimoduleTasks = rootProject.tasks.withType() - assertTrue(multimoduleTasks.isNotEmpty(), "Expected at least one multimodule task") - - multimoduleTasks.configureEach { task -> - task.moduleName by "custom Module Name" - task.documentationFileName by "customDocumentationFileName.md" - task.outputDirectory by task.project.buildDir.resolve("customOutputDirectory") - task.cacheRoot by File("customCacheRoot") - task.pluginsConfiguration.put("pluginA", "configA") - task.failOnWarning by true - task.offlineMode by true + multiModuleTask.apply { + moduleName by "custom Module Name" + outputDirectory by project.buildDir.resolve("customOutputDirectory") + cacheRoot by File("customCacheRoot") + pluginsConfiguration.put("pluginA", "configA") + failOnWarning by true + offlineMode by true } - multimoduleTasks.forEach { task -> - val dokkaConfiguration = task.buildDokkaConfiguration() - assertEquals( - DokkaConfigurationImpl( - moduleName = "custom Module Name", - outputDir = task.project.buildDir.resolve("customOutputDirectory"), - cacheRoot = File("customCacheRoot"), - pluginsConfiguration = mapOf("pluginA" to "configA"), - pluginsClasspath = emptyList(), - failOnWarning = true, - offlineMode = true, - modules = listOf( - DokkaModuleDescriptionImpl( - name = "child", - path = File("child"), - docFile = childProject.projectDir.resolve("customDocumentationFileName.md") - ) + val dokkaConfiguration = multiModuleTask.buildDokkaConfiguration() + assertEquals( + DokkaConfigurationImpl( + moduleName = "custom Module Name", + outputDir = multiModuleTask.project.buildDir.resolve("customOutputDirectory"), + cacheRoot = File("customCacheRoot"), + pluginsConfiguration = mapOf("pluginA" to "configA"), + pluginsClasspath = emptyList(), + failOnWarning = true, + offlineMode = true, + modules = listOf( + DokkaModuleDescriptionImpl( + name = "child", + relativePathToOutputDirectory = File("child"), + includes = setOf(include1, include2) ) - ), - dokkaConfiguration - ) - } + ) + ), + dokkaConfiguration + ) } @Test fun `setting dokkaTaskNames declares proper task dependencies`() { - val multimoduleTasks = rootProject.tasks.withType() - assertTrue(multimoduleTasks.isNotEmpty(), "Expected at least one multimodule task") + val dependenciesInitial = multiModuleTask.taskDependencies.getDependencies(multiModuleTask).toSet() + assertEquals(1, dependenciesInitial.size, "Expected one dependency") + val dependency = dependenciesInitial.single() - multimoduleTasks.toList().forEach { task -> - val dependencies = task.taskDependencies.getDependencies(task).toSet() - assertEquals(1, dependencies.size, "Expected one dependency") - val dependency = dependencies.single() + assertTrue(dependency is DokkaTask, "Expected dependency to be of Type ${DokkaTask::class.simpleName}") + assertEquals(childProject, dependency.project, "Expected dependency from child project") - assertTrue(dependency is DokkaTask, "Expected dependency to be of Type ${DokkaTask::class.simpleName}") - assertEquals(childProject, dependency.project, "Expected dependency from child project") - } val customDokkaTask = childProject.tasks.create("customDokkaTask") - multimoduleTasks.toList().forEach { task -> - task.addSubprojectChildTasks("customDokkaTask") - val dependencies = task.taskDependencies.getDependencies(task).toSet() + multiModuleTask.addSubprojectChildTasks("customDokkaTask") + val dependenciesAfter = multiModuleTask.taskDependencies.getDependencies(multiModuleTask).toSet() + + assertEquals(2, dependenciesAfter.size, "Expected two dependencies") + assertTrue(customDokkaTask in dependenciesAfter, "Expected 'customDokkaTask' in dependencies") - assertEquals(2, dependencies.size, "Expected two dependencies") - assertTrue(customDokkaTask in dependencies, "Expected 'customDokkaTask' in dependencies") - } } @Test @@ -125,19 +124,38 @@ class DokkaMultiModuleTaskTest { } @Test - fun childDocumentationFiles() { - val parent = ProjectBuilder.builder().build() - val child = ProjectBuilder.builder().withName("child").withParent(parent).build() - - val parentTask = parent.tasks.create("parent") - val childTask = child.tasks.create("child") + fun childDokkaTaskIncludes() { + val childDokkaTaskInclude1 = childProject.file("include1") + val childDokkaTaskInclude2 = childProject.file("include2") + val childDokkaTaskInclude3 = childProject.file("include3") + + childDokkaTask.apply { + dokkaSourceSets.create("main") { + it.includes.from(childDokkaTaskInclude1, childDokkaTaskInclude2) + } + dokkaSourceSets.create("main2") { + it.includes.from(childDokkaTaskInclude3) + } + } - parentTask.addChildTask(childTask) - parentTask.documentationFileName by "module.txt" + val secondChildDokkaTaskInclude = childProject.file("include4") + val secondChildDokkaTask = childProject.tasks.create("secondChildDokkaTask") { + dokkaSourceSets.create("main") { + it.includes.from(secondChildDokkaTaskInclude) + } + } + multiModuleTask.addChildTask(secondChildDokkaTask) assertEquals( - listOf(parent.file("child/module.txt")), parentTask.childDocumentationFiles, - "Expected child documentation file being present" + mapOf( + ":child:childDokkaTask" to setOf( + childDokkaTaskInclude1, + childDokkaTaskInclude2, + childDokkaTaskInclude3 + ), + ":child:secondChildDokkaTask" to setOf(secondChildDokkaTaskInclude) + ), + multiModuleTask.childDokkaTaskIncludes ) } @@ -177,6 +195,5 @@ class DokkaMultiModuleTaskTest { listOf(parent.project.buildDir.resolve("child")), parentTask.targetChildOutputDirectories, "Expected child target output directory being present" ) - } }