<According> to <@UH6ATH2AJ> &gt; `withJavadocJar()...
# dokka
e
According to @Kamil Doległo
withJavadocJar()
packs the output of the
javadoc
task, so you can override this task and run dokka inside
How may I do that?
k
If you ask about creating a
withJavadocJar()
for Kotlin Plugin then it’s not possible right now, I presume, as they would have to have a dependency on Dokka. If you just want to create a task, then here you go:
Copy code
register<Jar>("javadocJar") {
    dependsOn(dokkaHtml)
    archiveClassifier.set("javadoc")
    from(dokkaOutputDir)
}
e
cant dokka then offer it directly?
also,
dokkaOutputDir
is undefined
k
We probably could, but this may lead to some frustrating issues, eg. same task is used for Java’s javadoc and dokkaHtml generation, which would probably fail or produce just garbage with overwriting one documentation with another etc. Yeah, you have to define that yourself. I’d propose also configuring it in the
dokkaHtml
to have it pointed exactly at the same directory
l
I used the following and it works like a charm:
Copy code
task androidJavadocsJar(type: Jar, dependsOn: dokkaJavadoc) {
    archiveClassifier.set("javadoc")
    from(dokkaJavadoc.outputDirectory)
}
👍🏻 1