Skip to content

Commit 3c323f2

Browse files
authored
Support leaf modules in changed modules task. (#3871)
* Support leaf modules in changed modules task. The task should return the module even if nothing depends on it since it likely has tests of its own. * address review comments.
1 parent 6a565fc commit 3c323f2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

buildSrc/src/main/java/com/google/firebase/gradle/plugins/ci/ChangedModulesTask.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ abstract class ChangedModulesTask : DefaultTask() {
3333
AffectedProjectFinder(project, changedGitPaths.toSet(), listOf()).find().map { it.path }
3434
.toSet()
3535

36-
val result = mutableMapOf<String, MutableSet<String>>()
36+
val result = project.rootProject.subprojects.associate {
37+
it.path to mutableSetOf<String>()
38+
}
3739
project.rootProject.subprojects.forEach { p ->
3840
p.configurations.forEach { c ->
3941
c.dependencies.filterIsInstance<ProjectDependency>().forEach {
40-
result.getOrPut(it.dependencyProject.path) { mutableSetOf() }.add(p.path)
42+
result[it.dependencyProject.path]?.add(p.path)
4143
}
4244
}
4345
}

0 commit comments

Comments
 (0)