aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-plugin/src
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-20 10:59:28 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-20 11:46:28 +0200
commita9be511b052755258bc92225c4f5a8977f174b89 (patch)
tree5e5870c43c1e6acd55144e1221857d77adacc1c2 /runners/gradle-plugin/src
parenta7dec28a206ffb7fdeede1743edfd318bd1e2920 (diff)
downloaddokka-a9be511b052755258bc92225c4f5a8977f174b89.tar.gz
dokka-a9be511b052755258bc92225c4f5a8977f174b89.tar.bz2
dokka-a9be511b052755258bc92225c4f5a8977f174b89.zip
Add task descriptions to all dokka tasks
Diffstat (limited to 'runners/gradle-plugin/src')
-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()