-
I have a project that contains a feature variant:
It appears that the Dokkatoo plugin automatically configures a corresponding Dokkatoo source set, but when I run |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Dokkatoo will automatically discover all source sets, and prepare default configuration for them. However, by default Dokkatoo will mark non-main source sets as 'suppressed'. (Non-main source sets are suppressed by default, otherwise 'test' and 'test fixture' source sets will be included, and it's hard to determine just based on the name whether a source set should be enabled or not.) You can override the default though, by setting // build.gradle.kts
plugins {
`java-library`
id("dev.adamko.dokkatoo-html")
}
val variant by sourceSets.creating {}
java {
registerFeature("variant") {
usingSourceSet(variant)
}
}
dokkatoo {
// Dokkatoo will automatically configure the 'variant' source set, but will suppress it by default
dokkatooSourceSets.named("javaVariant") {
suppress = false
}
} Note that Dokkatoo adds a 'java' prefix to Java source sets. (This was done to prevent the 'main' Java source set from clashing with the main Kotlin source set in Kotlin JVM projects.) And, I have a tip: If you create the variant source set in a convention plugin, then Gradle will generate a typesafe accessor: // buildSrc/src/main/kotlin/my-java-variant.gradle.kts
plugins {
`java-library`
}
val variant by sourceSets.creating {}
java {
registerFeature("variant") {
usingSourceSet(variant)
}
} // my-subproject/build.gradle.kts
plugins {
id("my-java-variant")
id("dev.adamko.dokkatoo-html")
}
dokkatoo {
dokkatooSourceSets.javaVariant {
suppress = false
displayName = "Variant" // pretty display name in the rendered Dokka
}
} (Head compiled, there might be some mistakes) |
Beta Was this translation helpful? Give feedback.
Dokkatoo will automatically discover all source sets, and prepare default configuration for them. However, by default Dokkatoo will mark non-main source sets as 'suppressed'.
(Non-main source sets are suppressed by default, otherwise 'test' and 'test fixture' source sets will be included, and it's hard to determine just based on the name whether a source set should be enabled or not.)
You can override the default though, by setting
suppress = false
for the variant source set: