Skip to content

Commit

Permalink
add parent tasks to dokka-integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Oct 23, 2023
1 parent bf27c4f commit f06e47a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dokka-integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
base
}

addDependencyToSubprojectTasks("assemble")
addDependencyToSubprojectTasks("build")
addDependencyToSubprojectTasks("clean")
addDependencyToSubprojectTasks("check")

registerParentTask("integrationTest", groupName = "verification")

fun addDependencyToSubprojectTasks(existingTaskName: String) {
tasks.named(existingTaskName) {
dependsOn(subprojectTasks(existingTaskName))
}
}

fun registerParentTask(taskName: String, groupName: String) {
tasks.register(taskName) {
group = groupName
description = "Runs $taskName tasks of all subprojects"
dependsOn(subprojectTasks(taskName))
}
}

fun subprojectTasks(taskName: String): List<String> =
subprojects
.filter { it.getTasksByName(taskName, false).isNotEmpty() }
.map { ":${it.name}:$taskName" }

0 comments on commit f06e47a

Please sign in to comment.