forked from bestwpw/tachiyomi-extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
82 lines (71 loc) · 2.75 KB
/
settings.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
include(":core")
include(":lib-ratelimit")
project(":lib-ratelimit").projectDir = File("lib/ratelimit")
include(":duktape-stub")
project(":duktape-stub").projectDir = File("lib/duktape-stub")
include(":lib-dataimage")
project(":lib-dataimage").projectDir = File("lib/dataimage")
if (System.getenv("CI") == null) {
// Local development (full project build)
include(":multisrc")
project(":multisrc").projectDir = File("multisrc")
// Loads all extensions
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}")
}
}
// Loads generated extensions from multisrc
File(rootDir, "generated-src").eachDir { dir ->
dir.eachDir { subdir ->
val name = ":extensions:multisrc:${dir.name}:${subdir.name}"
include(name)
project(name).projectDir = File("generated-src/${dir.name}/${subdir.name}")
}
}
/**
* If you're developing locally and only want to work with a single module,
* comment out the parts above and uncomment below.
*/
// val lang = "all"
// val name = "mangadex"
// val projectName = ":extensions:individual:$lang:$name"
// val projectName = ":extensions:multisrc:$lang:$name"
// include(projectName)
// project(projectName).projectDir = File("src/${lang}/${name}")
// project(projectName).projectDir = File("generated-src/${lang}/${name}")
} 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 ->
val name = ":extensions:multisrc:${dir.name}:${subdir.name}"
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 ->
val name = ":extensions:individual:${dir.name}:${subdir.name}"
include(name)
project(name).projectDir = File("src/${dir.name}/${subdir.name}")
}
}
}
}
}
inline fun File.eachDir(block: (File) -> Unit) {
listFiles()?.filter { it.isDirectory }?.forEach { block(it) }
}