1
0
Fork 0
This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
tachiyomi-extensions/settings.gradle.kts
2024-01-08 17:36:05 -05:00

41 lines
1.1 KiB
Text

include(":core")
// Load all modules under /lib
File(rootDir, "lib").eachDir {
val libName = it.name
include(":lib-$libName")
project(":lib-$libName").projectDir = File("lib/$libName")
}
if (System.getenv("CI") == null) {
// Local development (full project build)
/**
* Add or remove modules to load as needed for local development here.
*/
loadAllIndividualExtensions()
// loadIndividualExtension("all", "komga")
} else {
// Running in CI (GitHub Actions)
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.eachDir(block: (File) -> Unit) {
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
}