ru.astrainteractive.gradleplugin.DokkaModulePlugin.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of convention Show documentation
Show all versions of convention Show documentation
GradlePlugin for my kotlin projects
package ru.astrainteractive.gradleplugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.withType
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import ru.astrainteractive.gradleplugin.property.extension.ModelPropertyValueExt.requireJinfo
class DokkaModulePlugin : Plugin {
override fun apply(target: Project) {
with(target.plugins) {
apply("org.jetbrains.dokka")
}
target.tasks.named("dokkaHtml").configure {
moduleName.set(project.name)
suppressObviousFunctions.set(false)
dokkaSourceSets.configureEach {
jdkVersion.set(target.requireJinfo.jtarget.majorVersion.toInt())
includeNonPublic.set(false)
skipDeprecated.set(false)
reportUndocumented.set(true)
skipEmptyPackages.set(true)
perPackageOption {
reportUndocumented.set(false)
}
}
}
target.tasks.withType().configureEach {
dokkaSourceSets.configureEach {
if (project.file("README.md").exists()) {
includes.from()
}
}
}
}
}