-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathsettings.gradle
178 lines (153 loc) · 5.82 KB
/
settings.gradle
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
/*
* Copyright (c) 2020-2030, Shuigedeng (981376577@qq.com & https://blog.taotaocloud.top/).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/release' }
maven { url "https://plugins.gradle.org/m2/" }
maven { url 'https://jetbrains.bintray.com/intellij-plugin-service' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://maven.aliyun.com/repository/public" }
maven { url 'https://repo.spring.io/plugins-release' }
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
}
plugins {
//https://plugins.gradle.org/plugin/com.gradle.enterprise
id "com.gradle.develocity" version "3.19.2"
}
import com.gradle.scan.plugin.PublishedBuildScan
develocity {
server = "https://gradle-enterprise.mycompany.com"
allowUntrustedServer = true
accessKey = "7w5kbqqjea4vonghohvuyra5bnvszop4asbqee3m3sm6dbjdudtq"
buildScan {
//publishAlways()
publishing.onlyIf { true }
uploadInBackground = false
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseUrl = "yes"
tag System.getProperty("os.name")
link "VCS", "/~https://github.com/myorg/sample/tree/${System.getProperty("vcs.branch")}"
//value "Build Number", project.version
capture {
fileFingerprints = true
buildLogging = true
testLogging = true
}
//buildFinished { BuildResult result ->
// if (result.failure) {
// value "Failed with", result.failure.message
// }
// value "Disk usage (output dir)", buildDir.directorySize().toString()
//}
buildScanPublished { PublishedBuildScan scan ->
file("scan-journal.log") << "${new Date()} - ${scan.buildScanId} - ${scan.buildScanUri}\n"
}
background {
def commitId = "git rev-parse --verify HEAD".execute().text.trim()
value "Git Commit ID", commitId
}
obfuscation {
hostname { host -> host.collect { character -> Character.getNumericValue(character as char) }.join("-") }
username { name -> name.reverse() }
ipAddresses { addresses -> addresses.collect { address -> "0.0.0.0" } }
}
}
}
rootProject.name = 'taotao-cloud-project'
dependencyResolutionManagement {
//repositories {
// // 使用阿里云 镜像仓库
// maven {url = URI("https://maven.aliyun.com/nexus/content/groups/public/") }
// //中黔私库
// maven { url = URI("https://code.zqfae.com/zqfae-repo/repository/zqfae-repo/") }
// mavenCentral()
//}
// 统一依赖库定义
versionCatalogs {
create("projectLibs"){
from(files("./gradle/libs.versions.toml"))
}
}
}
def oneLayerProjects = ['scala', 'python', 'design-patterns','cache','jdbcpool', 'netty']
for (project in oneLayerProjects) {
include "taotao-cloud-${project}"
}
def twoLayerProjects = ['bigdata', 'plugin', 'mq', 'rpc', 'tx', 'job']
for (project in twoLayerProjects) {
def dir = "taotao-cloud-${project}"
file("${rootDir}/${dir}").eachDir { directory ->
directory.eachDir { it ->
if (it.name != "build" && it.name != "out" && it.name != "bin" && it.name != "arthas-output") {
include "${dir}:${directory.name}"
}
}
}
}
def excludedName(file){
return file.name != "build"
&& file.name != "src"
&& file.name != "out"
&& file.name != "bin"
&& file.name != "arthas-output"
&& file.name != "config"
&& file.name != "public"
&& file.name != "node"
&& file.name != "node_modules"
&& file.name != ".frontend-gradle-plugin"
}
def threeLayerProjects = ['microservice', 'warehouse']
for (project in threeLayerProjects) {
def dir = "taotao-cloud-${project}"
file("${rootDir}/${dir}").eachDir { directory ->
if (excludedName(directory)) {
include "${dir}:${directory.name}"
directory.eachDir { it ->
if (excludedName(it)) {
include "${dir}:${directory.name}:${it.name}"
it.eachDir { four ->
if (excludedName(four)) {
include "${dir}:${directory.name}:${it.name}:${four.name}"
}
}
}
}
}
}
}
//buildCache{
// local{
// enable = true
// directory = new File(rootDir, 'build-cache')
// removeUnusedEntriesAfterDays = 30
// 其中directory设置的是目录,removeUnusedEntriesAfterDays是多长时间后清除未使用的缓存
// }
// remote(HttpBuildCache){
// url = 'http://example.com/cache'
// enable = true
// push = true
// }
//}
gradle.settingsEvaluated {
if (JavaVersion.current() < JavaVersion.VERSION_21) {
throw new GradleException("This build requires JDK 21. It's currently ${JavaVersion.current()}. You can ignore this check by passing '-Dorg.gradle.ignoreBuildJavaVersionCheck'.")
}
}