Last active
September 4, 2019 11:45
-
-
Save shkschneider/2980941d16943084300f30af6d99c06d to your computer and use it in GitHub Desktop.
The last settings.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun submodules(parent: String? = "", file: File) { | |
file.listFiles() | |
?.filter { it.isFile && it.name.endsWith(".gradle") } | |
?.forEach { | |
val module = it.parentFile.name | |
println(":$module") | |
include(":$module") | |
if (parent != null) { | |
project(":$module").projectDir = File(rootDir, "$parent/$module") | |
} | |
it.parentFile.listFiles() | |
?.filter { it.isDirectory && !it.name.startsWith(".") } | |
?.forEach { | |
submodules(module, it) | |
} | |
} | |
} | |
rootDir.listFiles()?.forEach { | |
submodules(null, it) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment