forked from isxcode/spark-yun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
154 lines (116 loc) · 4.44 KB
/
build.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
plugins {
id 'java'
id 'checkstyle'
id 'org.springframework.boot' version "${SPRING_VERSION}"
id 'io.spring.dependency-management' version "${SPRING_MANAGER_VERSION}"
id "com.diffplug.spotless" version "${SPOTLESS_VERSION}"
}
def version_number = new File(rootDir.getAbsolutePath(), 'spark-yun-backend/spark-yun-main/src/main/resources/VERSION').readLines()[0].trim()
allprojects {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'java-library'
apply plugin: 'checkstyle'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = 'com.isxcode.star'
version = version_number
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
mavenLocal()
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "https://plugins.gradle.org/m2/" }
}
configurations.configureEach {
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
exclude group: "org.slf4j", module: "slf4j-reload4j"
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation 'org.springframework.boot:spring-boot-starter-validation'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation "org.springdoc:springdoc-openapi-ui:${OPENAPI_VERSION}"
compileOnly "org.projectlombok:lombok:${LOMBOK_VERSION}"
annotationProcessor "org.projectlombok:lombok:${LOMBOK_VERSION}"
implementation "com.alibaba:fastjson:${FASTJSON_VERSION}"
implementation "org.junit.jupiter:junit-jupiter:${JUPITER_VERSION}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${JUPITER_VERSION}"
implementation "org.mapstruct:mapstruct:${MAPSTRUCT_VERSION}"
implementation "org.mapstruct:mapstruct-processor:${MAPSTRUCT_VERSION}"
annotationProcessor "org.mapstruct:mapstruct-processor:${MAPSTRUCT_VERSION}"
testAnnotationProcessor "org.mapstruct:mapstruct-processor:${MAPSTRUCT_VERSION}"
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
tasks.withType(Checkstyle).configureEach {
maxWarnings = 100
maxErrors = 0
ignoreFailures = false
config resources.text.fromFile(rootDir.getAbsolutePath() + '/.checkstyle/checkstyle.xml')
reports {
xml.required = false
html.required = true
html.stylesheet resources.text.fromFile(rootDir.getAbsolutePath() + '/.checkstyle/checkstyle-simple.xsl')
}
}
}
spotless {
java {
target '*/**/*.java'
targetExclude('*/build/**/*.java')
targetExclude('flink-yun-dist/**/*.java')
eclipse().configFile(rootDir.getAbsolutePath() + '/.spotless/eclipse-java-google-style.xml')
removeUnusedImports()
}
}
tasks.register('format', GradleBuild) {
tasks = [":spotlessApply", ":checkstyleMain"]
}
tasks.register('package', GradleBuild) {
tasks = [":spark-yun-dist:make"]
}
tasks.register('start', Exec) {
commandLine 'sh', '-c', '''
rm -rf spark-yun-dist/build/distributions/zhiqingyun
tar -vzxf spark-yun-dist/build/distributions/zhiqingyun.tar.gz -C spark-yun-dist/build/distributions/
cd spark-yun-dist/build/distributions/zhiqingyun/bin
bash start.sh
'''
}
tasks.register('docker', Exec) {
commandLine 'sh', '-c', '''
docker buildx uninstall
docker build -t isxcode/zhiqingyun:''' + version_number + ''' -f ./Dockerfile .
'''
}
tasks.register('website', Exec) {
commandLine 'sh', '-c', '''
cd docs
rm -rf node_modules
pnpm install --force
pnpm run dev
'''
}
tasks.register('frontend', Exec) {
commandLine 'sh', '-c', '''
cd spark-yun-frontend
rm -rf node_modules
pnpm install --force
pnpm run dev --host
'''
}
tasks.register('backend', GradleBuild) {
tasks = [":spark-yun-backend:spark-yun-main:bootRun"]
}
tasks.register('autotest', GradleBuild) {
tasks = [":spark-yun-autotest:autotest"]
}
tasks.register('install', Exec) {
commandLine 'sh', '-c', 'bash install.sh'
}