-
Notifications
You must be signed in to change notification settings - Fork 56
/
settings.gradle.kts
49 lines (45 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
import java.nio.file.Files
import java.nio.file.Path
rootProject.name = "Alter"
pluginManagement {
plugins {
kotlin("jvm")
}
}
plugins {
id("de.fayard.refreshVersions") version ("0.51.0")
id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0"
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
files("../gradle/libs.versions.toml")
}
}
}
include(":util")
include(":game-plugins")
include(":game-api")
include(":game-server")
include(":data-builder")
include(":plugins")
includePlugins(project(":plugins"))
fun includePlugins(pluginProject: ProjectDescriptor) {
val pluginPath = pluginProject.projectDir.toPath()
Files.walk(pluginPath).forEach {
if (!Files.isDirectory(it)) {
return@forEach
}
searchPlugin(pluginProject.name, pluginPath, it)
}
}
fun searchPlugin(parentName: String, pluginRoot: Path, currentPath: Path) {
val hasBuildFile = Files.exists(currentPath.resolve("build.gradle.kts"))
if (!hasBuildFile) {
return
}
val relativePath = pluginRoot.relativize(currentPath)
val pluginName = relativePath.toString().replace(File.separator, ":")
include("$parentName:$pluginName")
}