Tachiyomi-Extensions/settings.gradle.kts

44 lines
1.1 KiB
Plaintext
Raw Normal View History

2020-12-20 17:16:23 +00:00
include(":core")
2020-06-26 02:45:45 +00:00
// Load all modules under /lib
2024-01-22 21:19:41 +00:00
File(rootDir, "lib").eachDir { include("lib:${it.name}") }
2021-02-13 00:05:45 +00:00
// Load all modules under /lib-multisrc
File(rootDir, "lib-multisrc").eachDir { include("lib-multisrc:${it.name}") }
2021-02-13 00:05:45 +00:00
2024-01-22 21:19:41 +00:00
loadAllIndividualExtensions()
fun loadAllIndividualExtensions() {
File(rootDir, "src").eachDir { dir ->
dir.eachDir { subdir ->
2024-02-13 22:59:46 +00:00
include("src:${dir.name}:${subdir.name}")
}
}
}
fun loadIndividualExtension(lang: String, name: String) {
2024-02-13 22:59:46 +00:00
include("src:${lang}:${name}")
}
2024-01-22 21:19:41 +00:00
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)
}
2022-06-05 00:55:39 +00:00
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)
}
}
2024-01-09 03:14:00 +00:00
}