forked from rsmod/rsmod
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsettings.gradle.kts
39 lines (33 loc) · 946 Bytes
/
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
import java.nio.file.Files
import java.nio.file.Path
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "rsmod"
include("util")
include("game")
include("plugins")
includePlugins(project(":plugins").projectDir.toPath())
include("all")
pluginManagement {
plugins {
kotlin("jvm") version "1.4.0"
id("org.jmailen.kotlinter") version "3.3.0"
}
}
fun includePlugins(pluginPath: Path) {
Files.walk(pluginPath).forEach {
if (!Files.isDirectory(it)) {
return@forEach
}
searchPlugin(pluginPath, it)
}
}
fun searchPlugin(parent: Path, path: Path) {
val hasBuildFile = Files.exists(path.resolve("build.gradle.kts"))
if (!hasBuildFile) {
return
}
val relativePath = parent.relativize(path)
val pluginName = relativePath.toString().replace(File.separator, ":")
include("plugins:$pluginName")
}