How does dokka resolve cross-module links? I have ...
# dokka
m
How does dokka resolve cross-module links? I have a case where a link goes to the wrong module. Any idea where to look for ? (details in thread)
For an example there: https://apollographql.github.io/apollo-android/kdoc/apollo-runtime/com.apollographql.apollo3/-apollo-client/query.html
ApolloResponse
links to
apollo-adapters
while it should have been
apollo-api
m
Dokka’s partial tasks render as much as they can and if some things are not resolvable (like this link) they leave a template to be filled later. Then the root multimodule task comes and searches for those blanks to fill them. Linking is made by simple, external linking via package lists i’ll take a look at this case
🙏 1
m
Thanks! I might be missing something, I didn't customize much of the setup: https://github.com/apollographql/apollo-android/blob/dev-3.x/build-logic/src/main/kotlin/Publishing.kt#L37
k
This is a split-package issue which is currently not handled by Dokka, so it links to the first entry it can find
👍 1
m
Ok, so the issue is present because you have something called “split packages”. It is a situation where 2 gradle modules have the same package and dokka doesn’t know where to link, so it links to first one. Unfortunately in this case it leads to unresolved link 😞 In your case the package
com.apollographql.apollo3.api
is splitted between
apollo-api
and
apollo-adapters
I’ve created an issue to track this as eventually it would be nice to fix: https://github.com/Kotlin/dokka/issues/2037
🙏 1
🙏 1
👍 1
m
Thanks! I guess we should update the package names in all cases. We're still alpha so it's still doable
Thanks! It's working well (fix for apollo-adapters is there)
We also have a "main" module that puts classes in the
com.apollographql.apollo3
package. It's the only one, all others putting classes in
com.apollogrpahql.apollo3.$moduleName
. Could that be a problem too or is this ok?
(this one would be way harder to "fix" as there's a lot of code out there that relies on it)