Skip to content

Commit

Permalink
build(Gradle): Work on tasks instead of their providers to simplify code
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Apr 29, 2024
1 parent 28c4178 commit d300540
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,12 @@ tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
// all dependencies at once is beneficial, e.g. for debugging version conflict resolution.
// [1]: https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html#sec:listing_dependencies
tasks.register("allDependencies") {
val dependenciesTasks = allprojects.map { it.tasks.named<DependencyReportTask>("dependencies") }
val dependenciesTasks = allprojects.map { it.tasks.named<DependencyReportTask>("dependencies").get() }
dependsOn(dependenciesTasks)

// Ensure deterministic output by requiring to run tasks after each other in always the same order.
dependenciesTasks.zipWithNext().forEach { (a, b) ->
b.configure {
mustRunAfter(a)
}
b.mustRunAfter(a)
}
}

Expand Down

0 comments on commit d300540

Please sign in to comment.