:wave: I'm trying to run `./gradlew dokkaJavadoc` ...
# dokka
j
đź‘‹ I'm trying to run
./gradlew dokkaJavadoc
following the multiplatform configuration specified here https://kotlin.github.io/dokka/1.6.0/user_guide/gradle/usage/#multiplatform but the following error:
Pre-generation validity check failed: Dokka Javadoc plugin currently does not support generating documentation for multiplatform project. Please, adjust your configuration
Is this a known defect?
m
Javadoc doesn’t (and probably never will) support MPP projects. This is a design decision as format is not capable of elegantly displaying many platforms. If you really want the javadoc then you can only generate it for 1 platform by suppressing other in gradle
j
Yeah I'm fine with just generating javadoc for the jvm target, but am unable to do that
Copy code
tasks.dokkaJavadoc {
    dokkaSourceSets.configureEach { suppress.set(true) }

    dokkaSourceSets.getByName("commonMain") {
        suppress.set(false)
        platform.set(org.jetbrains.dokka.Platform.jvm)
        sourceRoots.from(kotlin.sourceSets.getByName("jvmMain").kotlin.srcDirs)
        sourceRoots.from(kotlin.sourceSets.getByName("commonMain").kotlin.srcDirs)
    }
}
this generates the html stuff, which I find surprising
or does the javadoc capability not support multiple sourcesets?
m
hmm as far as a i remember there was a possibility to have more sourcesets but they had to be on either JVM or common platforms. Why do you do it this way instead of just enabling commonMain and jvmMain?
j
my work build requires that everything used in our monolith has doc strings, so our new MPP project's -jvm target must have an associated javadoc jar. I'd like to just enable commonMain and jvmMain (I think my code block listed above does this) but the
kotlinSourceSetMetadata/commonMain
is just an empty directory in