Improve how modules are merged - relativePathToOutputDirectory
can't handle a module that is not a child
#2866
Labels
relativePathToOutputDirectory
can't handle a module that is not a child
#2866
Describe the bug
DokkaModuleDescription.relativePathToOutputDirectory
is used by Dokka when aggregating Dokka Modules into a single directory.The value is used to create subdirectories in the Dokka output directory. For example, if there are two modules, where
relativePathToOutputDirectory
ischildProjectA
one andchildProjectB
in another, there will be equivalent subdirectories in the result.The value of
relativePathToOutputDirectory
is determined automatically by the relative path between the aggregating project and the module.dokka/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTask.kt
Lines 93 to 98 in daed35f
dokka/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout.kt
Lines 36 to 43 in daed35f
This is problematic because it cannot handle modules that are not in child directories. For example, if the aggregating project is not a direct parent of the children
Additionally:
relativePathToOutputDirectory
is confusing - it's more like "the relative path INSIDE the output directory" or "moduleDocPath" or just "modulePath".java.io.File
. It's tempting to pass in a relative path (e.g.../parentProject/childProjectA
) or an absolute path (e.g./usr/x/projects/my-project/docs/build/dokka/childProjectA
) - both are wrong. It should just be a plain string.relativePathToOutputDirectory = File("some/path")
doesn't work becausemkdir()
is useddokka/plugins/templating/src/main/kotlin/templates/TemplateProcessor.kt
Line 56 in daed35f
Expected behaviour
relativePathToOutputDirectory
is renamed to be more descriptive,DokkaModuleDescription.name
instead.mkdir()
is replaced withmkdirs()
Installation
Additional context
Fixing this would help with #2700
The text was updated successfully, but these errors were encountered: