From 8ec106388209543434f990fe3af6fb02a7caceb4 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Mon, 13 Jul 2020 09:50:18 +0200 Subject: Implement DokkaTasksTest --- .../main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt | 2 +- .../src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'runners/gradle-plugin/src/main/kotlin/org') 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 dc94cc7f..27d25884 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 @@ -23,7 +23,7 @@ open class DokkaCollectorTask : DefaultTask() { @TaskAction fun collect() { - val configurations = project.allDescendentProjects().toList() + val configurations = project.subprojects .filter { subProject -> subProject.name in modules } .flatMap { subProject -> dokkaTaskNames.mapNotNull(subProject.tasks::findByName) } .filterIsInstance() diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt index 3a7bcd0d..b6c5cbd8 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt @@ -32,15 +32,6 @@ internal fun Project.isMultiplatformProject() = try { internal fun KotlinTarget.isAndroidTarget() = this.platformType == KotlinPlatformType.androidJvm -internal fun Project.allDescendentProjects(): Sequence { - return sequence { - yieldAll(subprojects) - subprojects.forEach { subproject -> - yieldAll(subproject.allDescendentProjects()) - } - } -} - internal fun NamedDomainObjectContainer.maybeCreate(name: String, configuration: T.() -> Unit): T { return findByName(name) ?: create(name, configuration) } -- cgit