I have a project where all the source is in Kotlin. I have configured Dokka to create Javadoc documentation using dokkaJavadoc and configured that to place it in the same place where the javadoc task would have placed documentation generated from Java sources. That’s the only way I can get the build task to include the Javadoc documentation (through withJavadocJar()). However, I want to specify an explicit dependency between the javadocJar task (not explicitly invoked in build.gradle.kts) and dokkaJavadoc, so that they run in the correct order. What’s the right way to do this? I’m able to say
tasks.build {
dependsOn(tasks.dokkaJavadoc)
}
but
tasks.javadocJar {
dependsOn(tasks.dokkaJavadoc)
}
gives script compilation errors:
Script compilation errors:
Line 134: tasks.javadocJar {
^ Unresolved reference: javadocJar
Line 135: dependsOn(tasks.dokkaJavadoc)
^ Unresolved reference: dependsOn
2 errors
How do I fix that?