2021-02-08 21:37:48 +00:00
|
|
|
include(":annotations")
|
2020-12-20 17:16:23 +00:00
|
|
|
include(":core")
|
2020-06-26 02:45:45 +00:00
|
|
|
|
|
|
|
include(":lib-ratelimit")
|
|
|
|
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
|
|
|
|
|
2021-02-08 21:37:48 +00:00
|
|
|
include(":duktape-stub")
|
|
|
|
project(":duktape-stub").projectDir = File("lib/duktape-stub")
|
|
|
|
|
2020-06-26 02:45:45 +00:00
|
|
|
include(":lib-dataimage")
|
|
|
|
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
|
|
|
|
2021-06-20 21:45:22 +00:00
|
|
|
if (System.getenv("CI") == null) {
|
|
|
|
// Local development (full project build)
|
2021-02-13 00:05:45 +00:00
|
|
|
|
|
|
|
include(":multisrc")
|
|
|
|
project(":multisrc").projectDir = File("multisrc")
|
|
|
|
|
|
|
|
// Loads all extensions
|
|
|
|
File(rootDir, "src").eachDir { dir ->
|
|
|
|
dir.eachDir { subdir ->
|
2021-03-09 22:50:49 +00:00
|
|
|
val name = ":extensions:individual:${dir.name}:${subdir.name}"
|
2021-02-13 00:05:45 +00:00
|
|
|
include(name)
|
|
|
|
project(name).projectDir = File("src/${dir.name}/${subdir.name}")
|
|
|
|
}
|
2020-12-16 03:18:54 +00:00
|
|
|
}
|
2021-02-13 00:05:45 +00:00
|
|
|
// Loads generated extensions from multisrc
|
|
|
|
File(rootDir, "generated-src").eachDir { dir ->
|
|
|
|
dir.eachDir { subdir ->
|
2021-03-09 22:50:49 +00:00
|
|
|
val name = ":extensions:multisrc:${dir.name}:${subdir.name}"
|
2021-02-13 00:05:45 +00:00
|
|
|
include(name)
|
|
|
|
project(name).projectDir = File("generated-src/${dir.name}/${subdir.name}")
|
|
|
|
}
|
2021-02-06 22:32:04 +00:00
|
|
|
}
|
2020-06-26 02:45:45 +00:00
|
|
|
|
2021-02-13 00:05:45 +00:00
|
|
|
/**
|
|
|
|
* If you're developing locally and only want to work with a single module,
|
|
|
|
* comment out the parts above and uncomment below.
|
|
|
|
*/
|
2021-08-22 14:30:29 +00:00
|
|
|
// val lang = "all"
|
|
|
|
// val name = "mangadex"
|
|
|
|
// val projectName = ":extensions:individual:$lang:$name"
|
|
|
|
// include(projectName)
|
|
|
|
// project(projectName).projectDir = File("src/${lang}/${name}")
|
2021-02-13 00:05:45 +00:00
|
|
|
} else {
|
|
|
|
// Running in CI (GitHub Actions)
|
|
|
|
|
|
|
|
val isMultisrc = System.getenv("CI_MULTISRC") == "true"
|
|
|
|
val lang = System.getenv("CI_MATRIX_LANG")
|
|
|
|
|
|
|
|
if (isMultisrc) {
|
|
|
|
include(":multisrc")
|
|
|
|
project(":multisrc").projectDir = File("multisrc")
|
|
|
|
|
|
|
|
// Loads generated extensions from multisrc
|
|
|
|
File(rootDir, "generated-src").eachDir { dir ->
|
|
|
|
if (dir.name == lang) {
|
|
|
|
dir.eachDir { subdir ->
|
2021-03-09 22:50:49 +00:00
|
|
|
val name = ":extensions:multisrc:${dir.name}:${subdir.name}"
|
2021-02-13 00:05:45 +00:00
|
|
|
include(name)
|
|
|
|
project(name).projectDir = File("generated-src/${dir.name}/${subdir.name}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Loads all extensions
|
|
|
|
File(rootDir, "src").eachDir { dir ->
|
|
|
|
if (dir.name == lang) {
|
|
|
|
dir.eachDir { subdir ->
|
2021-03-09 22:50:49 +00:00
|
|
|
val name = ":extensions:individual:${dir.name}:${subdir.name}"
|
2021-02-13 00:05:45 +00:00
|
|
|
include(name)
|
|
|
|
project(name).projectDir = File("src/${dir.name}/${subdir.name}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-11 14:41:48 +00:00
|
|
|
|
2020-06-26 02:45:45 +00:00
|
|
|
inline fun File.eachDir(block: (File) -> Unit) {
|
|
|
|
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
|
|
|
|
}
|