All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ru.astrainteractive.gradleplugin.DokkaRootPlugin.kt Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
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)
                }
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy