-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.gradle.kts
47 lines (38 loc) · 1.17 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
rootProject.name = "drinkit"
// Gradle Multi projects
// https://docs.gradle.org/current/userguide/intro_multi_project_builds.html#sec:project_standard
// Here we dynamically includes all gradle subprojects from specified folders
val excludedFolders = setOf(
"build",
"node_modules",
"out",
"buildSrc",
)
fun addGradleProject(folder: File) {
include(folder.name)
project(":${folder.name}").projectDir = folder.absoluteFile
}
fun containsAGradleFile(folder: File): Boolean {
if (!folder.isDirectory) {
return false
}
return folder.listFiles()
?.any { it.name.equals("build.gradle.kts") } == true
}
fun includeModules(folder: File) {
if (!folder.isDirectory || folder.isHidden) {
return
}
if (containsAGradleFile(folder)) {
addGradleProject(folder)
return
}
folder.listFiles()
?.filter { it.isDirectory && !it.isHidden }
?.filter { !excludedFolders.contains(it.name) }
?.filter { containsAGradleFile(it) }
?.forEach { addGradleProject(it) }
}
includeModules(file("tech-starters/backend"))
includeModules(file("drinkit"))
includeModules(file("deployment/updater"))