48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
include(":core")
|
|
|
|
// Load all modules under /lib
|
|
File(rootDir, "lib").eachDir { include("lib:${it.name}") }
|
|
|
|
// Load all modules under /lib-multisrc
|
|
File(rootDir, "lib-multisrc").eachDir { include("lib-multisrc:${it.name}") }
|
|
|
|
|
|
|
|
loadAllIndividualExtensions()
|
|
|
|
|
|
fun loadAllIndividualExtensions() {
|
|
File(rootDir, "src").eachDir { dir ->
|
|
dir.eachDir { subdir ->
|
|
val name = ":extensions:individual:${dir.name}:${subdir.name}"
|
|
include(name)
|
|
project(name).projectDir = File("src/${dir.name}/${subdir.name}")
|
|
}
|
|
}
|
|
}
|
|
fun loadIndividualExtension(lang: String, name: String) {
|
|
val projectName = ":extensions:individual:$lang:$name"
|
|
include(projectName)
|
|
project(projectName).projectDir = File("src/${lang}/${name}")
|
|
}
|
|
|
|
fun File.getChunk(chunk: Int, chunkSize: Int): List<File>? {
|
|
return listFiles()
|
|
// Lang folder
|
|
?.filter { it.isDirectory }
|
|
// Extension subfolders
|
|
?.mapNotNull { dir -> dir.listFiles()?.filter { it.isDirectory } }
|
|
?.flatten()
|
|
?.sortedBy { it.name }
|
|
?.chunked(chunkSize)
|
|
?.get(chunk)
|
|
}
|
|
|
|
fun File.eachDir(block: (File) -> Unit) {
|
|
val files = listFiles() ?: return
|
|
for (file in files) {
|
|
if (file.isDirectory && file.name != ".gradle" && file.name != "build") {
|
|
block(file)
|
|
}
|
|
}
|
|
} |