-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.gradle.kts
81 lines (68 loc) · 2.43 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
* This file was generated by the Gradle 'init' task.
*/
pluginManagement {
repositories {
maven { url = uri("https://repo.spring.io/milestone") }
gradlePluginPortal()
}
}
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("springBoot", "3.3.4")
plugin("spring-boot", "org.springframework.boot").versionRef("springBoot")
library("groovy-core", "org.codehaus.groovy:groovy:3.0.5")
library("groovy-json", "org.codehaus.groovy:groovy-json:3.0.5")
library("groovy-nio", "org.codehaus.groovy:groovy-nio:3.0.5")
library("commons-lang3", "org.apache.commons", "commons-lang3").version {
strictly("[3.8, 4.0[")
prefer("3.9")
}
}
}
}
rootProject.name = "unicorn-swarm"
val kotlinVersion = "2.0.0"
val excludes = providers.gradleProperty("excludeProjects").orNull.toString().split(",")
val buildFiles = fileTree(rootDir) {
include("**/*.gradle", "**/*.gradle.kts")
exclude(
"build",
"**/gradle",
"settings.gradle",
"settings.gradle.kts",
"buildSrc",
"/build.gradle",
"/build.gradle.kts",
".*",
"out"
)
if (kotlinVersion.matches(Regex("^1\\.[0-8]\\.\\d{1,2}\$|^0\\.\\d+\\.\\d+\$")) ||
kotlinVersion.matches(Regex("^1\\.9\\.[0-1]{1,2}-?(Beta|RC)?[0-9]?\$"))
) {
extra["kotlinEnable"] = false
exclude("**/*-kotlin.gradle.kts")
}
exclude(excludes)
}
buildFiles.forEach { buildFile ->
val isDefaultName = buildFile.name == "build.gradle" || buildFile.name == "build.gradle.kts"
val isKotlin = buildFile.name.endsWith(".kts")
// if (extra["kotlinEnable"] == false && buildFile.name == "valentine-starter.gradle") return
//
if (isDefaultName) {
val buildFilePath = buildFile.parentFile.absolutePath
val projectPath = buildFilePath.replace(rootDir.absolutePath.toString(), "").replace(File.separator, ":")
include(projectPath)
} else {
val projectName =
if (isKotlin) buildFile.name.replace(".gradle.kts", "") else buildFile.name.replace(".gradle", "")
val projectPath = ":$projectName"
include(projectPath)
val project = findProject(projectPath)
project?.name = projectName
project?.projectDir = buildFile.parentFile
project?.buildFileName = buildFile.name
}
}