Skip to content

Commit

Permalink
refactor(Gradle): Avoid the use of {all,sub}projects altogether
Browse files Browse the repository at this point in the history
See [1] for background information.

[1]: https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:convention_plugins_vs_cross_configuration

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Apr 29, 2024
1 parent 7ec5fa9 commit b47b7ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ 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").get() }.sorted()
val dependenciesTasks = getTasksByName("dependencies", /* recursive = */ true).sorted()
dependsOn(dependenciesTasks)

// Ensure deterministic output by requiring to run tasks after each other in always the same order.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
// their own.
val embeddedProjects = setOf("gradle-plugin", "web-app-template")

project.subprojects.filter {
childProjects.values.filter {
it.name !in embeddedProjects
}.forEach {
api(it)
Expand Down

0 comments on commit b47b7ff

Please sign in to comment.