Skip to content

Instantly share code, notes, and snippets.

@shkschneider
Last active September 4, 2019 11:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shkschneider/2980941d16943084300f30af6d99c06d to your computer and use it in GitHub Desktop.
The last settings.gradle.kts
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