Are you able to exclude some submodules when runni...
# dokka
a
Are you able to exclude some submodules when running
dokkaHtmlMultiModule
? I have a submodule that publishes a javadoc artifact but I don't want to include it in my unified dokka HTML
a
Awesome! Thanks
I was only looking in the multimodule task
j
Yeah I suspect they'll overhaul this whole system when project isolation comes
2
a
Yeah, they and tons of other "magic plugins" that just find stuff for you. Not sure how this is supposed to work in an isolated world though
i
If you don't apply Dokka in a submodule, it won't generate docs for it. An example here: https://github.com/Kotlin/kotlinx.serialization/blob/33104957873448189eb242413646b58883623e0a/gradle/dokka.gradle#L8
a
Right, but I still want dokka in that module because I'm publishing it to maven central and they require a javadoc artifact
j
It used to be a PITA to do empty javadoc jars but it's not so bad now https://github.com/cashapp/zipline/blob/trunk/zipline-bytecode/build.gradle.kts#L22-L28
a
Oh that's not so bad. Though I'm not sure what I think is best here TBH. But this is an academic issue as nobody uses those jars anyway. Android Studio at least only uses sources AFAIK
j
Yep
i
JFYI addChild/removeChild task functions will be deprecated with warning in the upcoming release, and removed when project isolation is implemented as we likely won't be able to support them. We were actually hoping no one was using them :( No alternative/replacement yet, it's just a measure to discourage more usage and a warning that it'll need to be refactored at some point. We'll provide a migration guide though when the time comes. Until then, it's fine to use it
You can try disabling individual Dokka tasks via the Gradle API,
task.enabled = false
. The task for generating submodule docs is
dokkaHtmlPartial
j
I would think a "proper" solution would be to use normal dependencies with attributes that allow consumption of the partial results. The same way AGP can consume partial things like only the manifest from another dependency. So our root project would have a normal configuration named dokkaMultiMoldule and we would add normal project dependencies. You would lose automatic aggregation of all projects, but perhaps opt-in is better anyway.
306 Views