aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt12
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaPluginApplyTest.kt12
2 files changed, 23 insertions, 1 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt
index 8ba28e83..f5dc9366 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/main.kt
@@ -8,21 +8,26 @@ import org.gradle.kotlin.dsl.register
open class DokkaPlugin : Plugin<Project> {
override fun apply(project: Project) {
- project.setupDokkaTasks("dokkaHtml")
+ project.setupDokkaTasks("dokkaHtml") {
+ description = "Generates documentation in 'html' format"
+ }
project.setupDokkaTasks(
name = "dokkaJavadoc",
multiModuleTaskSupported = false
) {
plugins.dependencies.add(project.dokkaArtifacts.javadocPlugin)
+ description = "Generates documentation in 'javadoc' format"
}
project.setupDokkaTasks("dokkaGfm") {
plugins.dependencies.add(project.dokkaArtifacts.gfmPlugin)
+ description = "Generates documentation in GitHub flavored markdown format"
}
project.setupDokkaTasks("dokkaJekyll") {
plugins.dependencies.add(project.dokkaArtifacts.jekyllPlugin)
+ description = "Generates documentation in Jekyll flavored markdown format"
}
}
@@ -47,10 +52,13 @@ open class DokkaPlugin : Plugin<Project> {
val multiModuleName = "${name}MultiModule"
project.maybeCreateDokkaPluginConfiguration(multiModuleName)
project.maybeCreateDokkaRuntimeConfiguration(multiModuleName)
+
project.tasks.register<DokkaMultiModuleTask>(multiModuleName) {
addSubprojectChildTasks(name)
configuration()
+ description = "Runs all subprojects '$name' tasks and generates module navigation page"
}
+
project.tasks.register<DefaultTask>("${name}Multimodule") {
dependsOn(multiModuleName)
doLast {
@@ -61,6 +69,8 @@ open class DokkaPlugin : Plugin<Project> {
if (collectorTaskSupported) {
project.tasks.register<DokkaCollectorTask>("${name}Collector") {
addSubprojectChildTasks(name)
+ description =
+ "Generates documentation merging all subprojects '$name' tasks into one virtual module"
}
}
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaPluginApplyTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaPluginApplyTest.kt
index db218b9f..0000cc78 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaPluginApplyTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaPluginApplyTest.kt
@@ -64,6 +64,18 @@ class DokkaPluginApplyTest {
}
@Test
+ fun `all dokka tasks provide a task description`() {
+ val project = ProjectBuilder.builder().build()
+ project.plugins.apply("org.jetbrains.dokka")
+ project.tasks.filter { "dokka" in it.name.toLowerCase() }.forEach { dokkaTask ->
+ assertTrue(
+ dokkaTask.description.orEmpty().isNotEmpty(),
+ "Expected description for task ${dokkaTask.name}"
+ )
+ }
+ }
+
+ @Test
fun `parent dokka tasks have children configured`() {
val root = ProjectBuilder.builder().withName("root").build()
val child = ProjectBuilder.builder().withName("child").withParent(root).build()