Limit the recursivity to 1, when searching for gradle modules.

This commit is contained in:
Benoit Marty
2023-03-28 14:51:30 +02:00
parent 2c2ce1b2e8
commit 1013e73ff8

View File

@@ -73,7 +73,7 @@ include(":services:appnavstate:impl")
include(":services:toolbox:api")
include(":services:toolbox:impl")
fun includeProjects(directory: File, path: String) {
fun includeProjects(directory: File, path: String, maxDepth: Int = 1) {
directory.listFiles().orEmpty().forEach { file ->
if (file.isDirectory) {
val newPath = "$path:${file.name}"
@@ -81,8 +81,8 @@ fun includeProjects(directory: File, path: String) {
if (buildFile.exists()) {
include(newPath)
println("Included project: $newPath")
} else {
includeProjects(file, newPath)
} else if (maxDepth > 0) {
includeProjects(file, newPath, maxDepth - 1)
}
}
}