-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
74 lines (64 loc) · 1.87 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
74 lines (64 loc) · 1.87 KB
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
@file:Suppress("ktlint:standard:kdoc")
pluginManagement {
includeBuild("gradle/build-logic")
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven(url = "https://www.jitpack.io")
}
}
dependencyResolutionManagement {
versionCatalogs {
create("ns") {
from(files("gradle/ns.versions.toml"))
}
create("kei") {
from(files("gradle/ns.versions.toml"))
}
}
@Suppress("UnstableApiUsage")
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
@Suppress("UnstableApiUsage")
repositories {
google()
mavenCentral()
maven(url = "https://www.jitpack.io")
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "NovelSourcery"
/**
* Add or remove modules to load as needed for local development here.
*/
loadAllIndividualExtensions()
// loadIndividualExtension("all", "mangadex")
/**
* ===================================== COMMON CONFIGURATION ======================================
*/
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}") }
/**
* ======================================== HELPER FUNCTION ========================================
*/
fun loadAllIndividualExtensions() {
File(rootDir, "src").eachDir { dir ->
dir.eachDir { subdir ->
include("src:${dir.name}:${subdir.name}")
}
}
}
fun loadIndividualExtension(lang: String, name: String) {
include("src:$lang:$name")
}
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)
}
}
}