ru.astrainteractive.gradleplugin.DokkaRootPlugin.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.withType
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTask
import java.io.File
class DokkaRootPlugin : Plugin {
override fun apply(target: Project) {
with(target.plugins) {
apply("org.jetbrains.dokka")
}
target.tasks.withType {
val paths = listOf("README.md", "dokka.md")
.map(project::file)
.filter(File::exists)
.map(File::getName)
includes.from(paths)
moduleName.set(target.name)
}
target.tasks.withType().configureEach {
dokkaSourceSets.configureEach {
perPackageOption {
reportUndocumented.set(false)
}
}
}
}
}