forked from blurite/rsprox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
54 lines (47 loc) · 1.28 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
import java.io.IOException
import java.nio.file.Files
import java.nio.file.Path
rootProject.name = "rsprox"
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
include(
"proxy",
"protocol",
"patch",
"gui",
"transcriber",
"cache",
"shared",
"launcher",
)
includeSubprojects(":protocol")
includeSubprojects(":patch")
includeSubprojects(":gui")
includeSubprojects(":transcriber")
includeSubprojects(":cache")
fun includeSubprojects(projectName: String) {
val projectPath = project(projectName).projectDir.toPath()
try {
Files.walk(projectPath).filter(Files::isDirectory).forEach {
searchSubproject(projectName, projectPath, it)
}
} catch (e: IOException) {
System.err.println("Failed to walk plugin dir, skipping")
}
}
fun searchSubproject(
projectName: String,
projectPath: Path,
subprojectPath: Path,
) {
val isMissingBuildFile = Files.notExists(subprojectPath.resolve("build.gradle.kts"))
if (isMissingBuildFile) return
val relativePath = projectPath.relativize(subprojectPath)
val subprojectName = relativePath.toString().replace(File.separator, ":")
include("$projectName:$subprojectName")
}