How do i use Dokka with `maven-publish` plugin to ...
# dokka
t
How do i use Dokka with
maven-publish
plugin to see the documentation in IDE’s documentation popup?
a
There is such a thing?
j
I think the question is about publishing proper Javadoc jar with Dokka's doc to Maven
If that's the case, you can use something like this to create a Jar from the generated doc:
Copy code
val dokkaJar by tasks.creating(Jar::class) {
    archiveClassifier.set("javadoc")
    from(tasks.findByName("dokkaHtml")) // or dokkaJavadoc if JVM-only project
}
And then use this task as artifact in your maven publication config using
artifact(dokkaJar)
.
t
@Joffrey okay will do that. Is there something like a complete guideline for this?
j
I'm not aware of such guide unfortunately
t
okay, no problem. thanks 🙂
j
The best I can do is link to an example. For instance, here is my setup for a multi-module project with a mix of multiplatform and JVM subprojects: https://github.com/joffrey-bion/krossbow/blob/main/build.gradle.kts#L90-L108
t
@Joffrey okay, Anything specific I need to do if its an android-library?
j
I don't think so. It's just a matter of which Dokka output format are available I believe (and Android most likely has everything), but I haven't developed for android in a very long time, so don't take my word for it 😄
t
All right 😄 I’ll look into it. thanks
270 Views