diff options
Diffstat (limited to 'runners/gradle-plugin')
3 files changed, 23 insertions, 0 deletions
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt index 38da9631..37952ea8 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.gradle import org.gradle.api.DefaultTask +import org.gradle.api.plugins.JavaBasePlugin +import org.gradle.api.plugins.JavaBasePlugin.DOCUMENTATION_GROUP import org.gradle.api.tasks.Input import org.gradle.api.tasks.TaskAction import java.lang.IllegalStateException @@ -48,6 +50,8 @@ open class DokkaCollectorTask : DefaultTask() { dokkaTaskNames.forEach { dokkaTaskName -> finalizedBy(dokkaTaskName) } + + group = DOCUMENTATION_GROUP } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt index cc7b8d86..6fd58afe 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt @@ -1,6 +1,8 @@ package org.jetbrains.dokka.gradle import com.google.gson.GsonBuilder +import org.gradle.api.plugins.JavaBasePlugin +import org.gradle.api.plugins.JavaBasePlugin.DOCUMENTATION_GROUP import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.jetbrains.dokka.plugability.Configurable @@ -59,4 +61,8 @@ open class DokkaMultimoduleTask : AbstractDokkaTask(), Configurable { private fun getSubprojectDokkaTasks(dokkaTaskNames: Set<String>): List<DokkaTask> { return dokkaTaskNames.flatMap { dokkaTaskName -> getSubprojectDokkaTasks(dokkaTaskName) } } + + init { + group = DOCUMENTATION_GROUP + } } diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt index 66283876..b948c540 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTasksTest.kt @@ -1,8 +1,10 @@ package org.jetbrains.dokka.gradle +import org.gradle.api.plugins.JavaBasePlugin import org.gradle.kotlin.dsl.withType import org.gradle.testfixtures.ProjectBuilder import kotlin.test.Test +import kotlin.test.assertEquals import kotlin.test.assertSame import kotlin.test.assertTrue @@ -49,4 +51,15 @@ class DokkaTasksTest { } } + @Test + fun `all dokka tasks are part of the documentation group`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("org.jetbrains.dokka") + project.tasks.filter { "dokka" in it.name.toLowerCase() }.forEach { dokkaTask -> + assertEquals( + JavaBasePlugin.DOCUMENTATION_GROUP, dokkaTask.group, + "Expected task: ${dokkaTask.path} group to be ${JavaBasePlugin.DOCUMENTATION_GROUP}" + ) + } + } } |