Surprised it wasn’t mentioned in the patch notes f...
# dokka
s
Surprised it wasn’t mentioned in the patch notes for 0.9.18, but Dokka can now be configured entirely in Kotlin build script!
🎉 2
m
no more
delegateClosureOf
nastiness?!
s
Not that I've seen! This is all it took to configure my multiplatform project for common and JVM docs:
Copy code
tasks.dokka {
    outputDirectory = "$rootDir/public/docs"
    impliedPlatforms = mutableListOf("Common")

    kotlinTasks { emptyList() }

    sourceRoot {
        path = kotlin.sourceSets.commonMain.get().kotlin.srcDirs.first().absolutePath
        platforms = listOf("Common")
    }

    sourceRoot {
        path = kotlin.jvm().compilations["main"].defaultSourceSet.kotlin.srcDirs.first().absolutePath
        platforms = listOf("JVM")
    }
}
👍 3
s
If you don't mind me asking @serebit, how do you get your JVM target's javadoc to create a jar? When I run
gradlew javadocJar
(from my task that makes the javadoc from dokka) it creates it for my common code, but not my jvm target. It doesn't create a jvmJavadocJar task automatically like other tasks unfortunately. 😞
s
That's odd, it's not creating one for me either @Shan 🤔
s
@serebit did you happen to figure out why it wasn't generating? I know Dokka is experimentally supporting MPP in next release version, so that might be the reason why it's not working just yet.
s
That would be my guess. I haven't really investigated it myself, but if you figure it out, feel free to let me know 😛
👍 1