My `includes` doesn’t seem to be getting picked up...
# dokka
b
My
includes
doesn’t seem to be getting picked up- what’s the best way to troubleshoot that? I don’t see anything in the logs that appears to be helpful, even when running with
--debug
. I’m running
./gradlew dokkaGfm
Here’s my configuration:
Copy code
dokkaGfm {
  def outputPath =  //..
  outputDirectory = file(outputPath)

  dokkaSourceSets {
    named("main") {
      jdkVersion = 8
      includes.from("README.md", "packages.md")
    }
  }
}
Neither README.md nor packages.md appear to be getting picked up. If it makes a difference, this is an Android library module.
m
Probably the easiest way is to use intellij's debugger with a cloned dokka repository. So you would need to clone dokka repository with desired tag, publish to maven local (
./gradlew pTML
) and set breakpoints (probably in
toDokkaSourceSetImpl.kt
or
DokkaTask.kt
). Then (on the documented repository) you enable debug in gradle using
org.gradle.debug = true
and run your task with remote profile on dokka. If your project is publicly available i can help you with it
b
It unfortunately is not public, but I’ll give that a shot today and let you know what I find! Thanks!
So far I haven’t been able to track down anything useful- I set a breakpoint in
GradleDokkaSourceSetBuilder.build()
and when I hit it
this.includes
is empty. I tried setting a breakpoint in
DefaultConfigurableFileCollection.from
to ensure that’s being called as expected, but that’s far too noisy to find the one invocation I’m looking for.
k
Could you please set a breakpoint somewhere in
DokkaGenerator
for example and check whether the configuration nested inside DokkaContext has those files (and JVM version, you could set that to something like 13 to stand out more) set?
b
Think I’m starting to get it figured out- we aren’t using Kotlin for our build scripts and had recently upgraded from an older Dokka version so our syntax was a bit off. Switching all the setters to use
.set()
is working better (e.g.
jdkVersion = 8
to
jdkVersion.set(8)
). Now the docs are being generated, but the
dokkaGfm
task is failing with “Unexpected classifier JVM”. Starting to hunt down the cause of that now
k
Unexpected classifier JVM
probably means that you have those includes formatted incorrectly
They should have a
# Module <modulename>
or
# Package <packagename>
headings as stated here: https://kotlinlang.org/docs/reference/kotlin-doc.html
b
Yep, that was it! Had one module that had a README I didn’t know about without the headers. Thanks!!
k
No problem 😉