Chris Overcash
04/17/2023, 3:00 PMallprojects {
apply(plugin = "org.jetbrains.dokka")
tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial>().configureEach {
dokkaSourceSets.configureEach {
includes.from("Module.md")
sourceLink {
localDirectory.set(projectDir.resolve("src/main/java"))
val branch = "main"
val moduleName = project.name
val srcDir = "src/main/java"
val rootUrl = "<https://internalgithub.com/app/tree>"
val url = "$rootUrl/$branch/$moduleName/$srcDir"
remoteUrl.set(java.net.URL(url))
}
}
}
}
Ignat Beresnev
04/17/2023, 3:32 PMsrc/main/java
, maybe try just src
instead?
You can look at the configuration of source links for kotlinx.coroutines, maybe that'll give you an ideaChris Overcash
04/17/2023, 3:34 PMIgnat Beresnev
04/17/2023, 3:35 PMlocalDirectory
setting from the source link configuration, it adds the source link button to the signature. So if the button is not showing up at all, the problem might in the local directory
You can try debugging it with println
to see which value is passed in thereChris Overcash
04/17/2023, 3:38 PMprintln(localDirectory)
?Ignat Beresnev
04/17/2023, 3:39 PMprintln(projectDir.resolve("src/main/java"))
within the configuration blockChris Overcash
04/17/2023, 3:42 PMlocalDirectory.set(projectDir.resolve("src"))
, and i’m still not getting the links in the output 😕src
and src/main/java
. this is my first experience with Dokka, but my assumption is that it needs the full src/main/java
in order to append the package name to that? e.g. <http://dev.covercash.app|dev.covercash.app>
-> src/main/java/dev/coverash/app
Ignat Beresnev
04/18/2023, 10:19 AMChris Overcash
04/18/2023, 3:39 PMlocalDirectory.set(projectDir.resolve("src/main/java")
, and in our Kotlin-only module the source code is linked properly. however, all our other modules have Android dependencies and do not link correctly. i’m not certain this is the problem, but it seems to be the only difference i can findnoStdlibLink.set(true)
noJdkLink.set(true)
noAndroidSdkLink.set(true)
since i’m having trouble getting those to download in our corporate networkIgnat Beresnev
04/26/2023, 1:51 PMChris Overcash
04/26/2023, 2:08 PM