-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
102 lines (81 loc) · 2.81 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
102 lines (81 loc) · 2.81 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import java.io.File
pluginManagement {
repositories {
mavenLocal()
val isCi = System.getenv().containsKey("CI") ||
System.getenv().containsKey("GITHUB_ACTIONS") ||
System.getenv().containsKey("JENKINS_HOME")
if (!isCi) {
maven(url = "https://mirrors.tencent.com/nexus/repository/maven-public/")
maven(url = "https://maven.aliyun.com/repository/gradle-plugin")
}
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositories {
mavenLocal()
val isCi = System.getenv().containsKey("CI") ||
System.getenv().containsKey("GITHUB_ACTIONS") ||
System.getenv().containsKey("JENKINS_HOME")
if (!isCi) {
maven(url = "https://mirrors.tencent.com/nexus/repository/maven-public/")
maven(url = "https://maven.aliyun.com/repository/public/")
}
mavenCentral()
gradlePluginPortal()
maven(url = "https://packages.confluent.io/maven/")
maven(url = "https://repository.cloudera.com/repository/cloudera-repos/")
}
}
rootProject.name = "bigdata-test"
val excludeProjects: String? by settings
val buildFiles = fileTree(rootDir) {
val excludes = excludeProjects?.split(",")
include("**/*.gradle", "**/*.gradle.kts")
exclude(
"build",
"**/gradle",
"settings.gradle",
"settings.gradle.kts",
"buildSrc",
"example/spring-gradle-plugin/**",
"/build.gradle",
"/build.gradle.kts",
".*",
"out"
)
exclude("**/grails3")
if (!excludes.isNullOrEmpty()) {
exclude(excludes)
}
}
val rootDirPath = rootDir.absolutePath + File.separator
buildFiles.forEach { buildFile ->
val isDefaultName = buildFile.name.startsWith("build.gradle")
val isKotlin = buildFile.name.endsWith(".kts")
if (isDefaultName) {
val buildFilePath = buildFile.parentFile.absolutePath
val projectPath = buildFilePath
.replace(rootDirPath, "")
.replace(File.separator, ":")
println("Adding project $projectPath")
include(projectPath)
} else {
val projectName = if (isKotlin) {
buildFile.name.removeSuffix(".gradle.kts")
} else {
buildFile.name.removeSuffix(".gradle")
}
val projectPath = ":$projectName"
println("Adding project $projectPath")
include(projectPath)
val project = findProject(projectPath)
project?.name = projectName
project?.projectDir = buildFile.parentFile
project?.buildFileName = buildFile.name
}
}
gradle.extra["isCi"] = System.getenv().containsKey("CI") ||
System.getenv().containsKey("GITHUB_ACTIONS") ||
System.getenv().containsKey("JENKINS_HOME")