I'm using gradle plugin v2. I have a project with ...
# dokka
r
I'm using gradle plugin v2. I have a project with sources and also some sub-projects. I'm using
dependencies {}
to aggregate documentation from the sub-projects but I also want to see the documentation for my root project. It doesn't seem to work by default. More in 🧵
I'm trying to use something like this:
Copy code
dependencies {
    dokka(rootProject)
    dokka(project(":subproject1"))
    dokka(project(":subproject2"))
    ...
}
and it almost works, but the index for the root project docs shows list of subprojects instead of packages. Can I somehow fix it? Is there a better solution?
I know I could create yet another subproject for my root sources, but I don't want to refactor the whole project.
a
Hmm, interesting, this should work. Can you share a screenshot of the current result? Does DGPv1 produce what you want?
r
I don't know about DGPv1 because I've never used it in my project in this configuration (Dokka 1 was not working for me with standard config). Now I'm already on v2.
A screenshot
If I click any module link other than the first, I will see the list of packages in that module.
But I can't see the list of packages for the first ("kvision") module because it is the main "index.html" and it contains the list of modules.
I can see the packages in the left panel only
a
I tried modifying the multimodule example to aggregate in the root project instead of the
:docs
subproject, and I get 404s when I try looking in the root project code, and I can see in the URL I see a double slash
//
so I think the name isn't being set correctly.
Copy code
<http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka//index.html>
Can you try adding this to the root project?
Copy code
dokka {
    modulePath = "root"
}
r
Almost perfect 🙂
The only problem is that the root module is now listed at the end in the left panel.
Can I use other name instead of "root" ("a_root") to make it first ?
a
yeah, almost any path is fine, just check the kdoc to learn more :)
I think
modulePath = "kvision"
would work
r
Thank you!
a
np, thanks for the report! It looks like a bug and might be fixable
it looks like there's a bug which removes a path element from the URL, so when opening the page locally the
html
dir is missing
Copy code
Expected:
<http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka/html/[root]/index.html>
Actual:
<http://localhost:63342/dokka/examples/gradle-v2/multimodule-example/build/dokka//index.html>