How can I configure `separateInheritedMembers` or ...
# dokka
d
How can I configure
separateInheritedMembers
or
suppressInheritedMembers
in a multimodule Android project, in Groovy? I want to configure everything from the root project, if possible.
m
the same way you configure any dokka multimodule task. You apply configuration to all tasks named “dokka<format>Partial” in subprojects
d
thanks, but I can't seem to find how to do that. If I do
Copy code
subprojects {
    tasks.named("dokkaHtmlPartial") {
        //outputDirectory.set(buildDir.resolve("dokka"))
    }
}
then it complains that this task doesn't exist in some subprojects.
m
Do you have dokka applied in the subproject that gradle complains about?
d
No. Some subprojects have dokka applied, others don't. I don't want documentation for all projects.
I also tried this in the root project:
Copy code
tasks.withType(dokkaHtml.getClass()).configureEach {
        dokkaSourceSets {
            configureEach {
                includes = listOf("README.md", "packages.md")
                pluginsMapConfiguration.set(
                        ["org.jetbrains.dokka.base.DokkaBase": """{
                        "separateInheritedMembers": true
                    }"""]
                )
            }
        }
    }
but also doesn't seem to work
m
then wrap your
tasks.named….
with this
🙏 1
d
Thanks. This seems to work:
Copy code
subprojects {
    pluginManager.withPlugin('org.jetbrains.dokka') {
        tasks.named("dokkaHtmlPartial") {
            //outputDirectory.set(new File(buildDir.getPath() + "/dokka"))
            pluginsMapConfiguration.set(
                    ["org.jetbrains.dokka.base.DokkaBase": """{
                        "separateInheritedMembers": true
                    }"""]
            )
            //suppressInheritedMembers.set(true)
            dokkaSourceSets {
                configureEach {
                    //includes.from('README.md', 'modules.md', 'packages.md')
                }
            }
        }
    }
}