Hi, I’m having trouble getting Dokka 1.4.30 to wor...
# dokka
c
Hi, I’m having trouble getting Dokka 1.4.30 to work with my multi-module project. The readme mentions that I should run
dokkaHtmlMultimodule
, however that task doesn’t exist. Also the most recent release notes mention I should use
dokkaHtmlPartial
, however that doesn’t work as then my
navigation.html
only contains the classes from one module. Am I missing something?
j
Apply the plugin to the root project
It kinda sucks, though. Can't exclude subprojects that I could see digging in the sources
c
Applying the plugin to the root project fixed it, thanks!
Also Dokka seems to ignore the test-utils and sample subprojects in my repo. No idea how that’s configured either, though
j
probably because they lack the dokka plugin. i still have modules that i publish which i want to omit from docs
c
Ah yep, that’s it. The dokka plugin is being applied to those modules by the maven publish plugin
k
Can’t exclude subprojects that I could see digging in the sources
@jw Can you please elaborate? Excluding subprojects should be fairly easy, either by removing the plugin from them or by removing them from
childDokkaTasks
in the root task
j
Well they still need doc jars for deployment to central so I don't want to remove the plugin. Removing tasks is not easy. Easy is support for a list of excluded project references in the extension. Removing tasks deps is brittle and requires me to further bake knowledge of tasks names that I don't care about and which are mostly implementation detail into my scripts. Maybe "possible" is a better description of that solution
k
Well, you can provide a list of excluded projects in the root task, you don’t have to know the tasks’ names:
Copy code
dokkaHtmlMultiModule {
 removeChildTasks(
  listOf(
   project(":subprojectA"),
   project(":subprojectB")
  )
 )
}
which is easy IMHO
🎉 1
j
That's exactly what I want! This isn't documented. Nor obvious from the extension type. So sure it's easy when you ask on Slack but I shouldn't have to
j
@Kamil Doległo is it not more comfortable a flag in the specific module?
k
Yeah, I’ll document that, however I just got it from the code completion 😉
is it not more comfortable a flag in the specific module?
Well flag in the specific module is not a good thing IMHO, but you can always disable the task in that module:
Copy code
dokkaHtmlPartial {
 enabled=false
}
j
Ah, code completion probably only works with .kts files. I find myself diving into the codebase to look at extensions more often than not since i'm using build.gradle. It sometimes works, but mostly doesn't.
This worked like a charm. Thanks!
☺️ 1