forked from MaaAssistantArknights/MaaBackendCenter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (113 loc) · 4.5 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
id 'io.freefair.lombok' version '8.4'
id 'org.springdoc.openapi-gradle-plugin' version '1.8.0'
id 'org.hidetake.swagger.generator' version '2.19.2'
id 'org.graalvm.buildtools.native' version '0.9.28'
}
group 'plus.maa'
version '1.0-SNAPSHOT'
repositories {
maven {
url 'https://maven.aliyun.com/repository/public/'
}
maven {
url 'https://maven.aliyun.com/repository/spring/'
}
mavenCentral()
}
ext {
// 统一管理版本号
hutoolVersion = '5.8.22'
}
dependencies {
annotationProcessor 'com.github.therapi:therapi-runtime-javadoc-scribe:0.13.0'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
implementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-cache'
//springdoc相关依赖没有被自动管理,必须保留版本号
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.1.0'
implementation 'com.github.therapi:therapi-runtime-javadoc:0.13.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.sun.mail:javax.mail:1.6.2'
// 双引号才能使用变量
implementation "cn.hutool:hutool-extra:$hutoolVersion"
implementation "cn.hutool:hutool-jwt:$hutoolVersion"
implementation "cn.hutool:hutool-dfa:$hutoolVersion"
implementation 'org.mapstruct:mapstruct:1.5.5.Final'
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.6.0.202305301015-r'
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache.agent:6.6.0.202305301015-r'
implementation 'org.freemarker:freemarker:2.3.32'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.6'
implementation 'com.github.erosb:everit-json-schema:1.14.2'
implementation 'com.google.guava:guava:32.1.1-jre'
implementation 'org.aspectj:aspectjweaver:1.9.19'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
swaggerCodegen 'org.openapitools:openapi-generator-cli:6.5.0'
}
test {
useJUnitPlatform()
}
def swagger_output_dir = "$buildDir/docs"
def swagger_output_name = 'swagger.json'
openApi {
apiDocsUrl.set("http://localhost:8848/v3/api-docs")
outputDir.set(file(swagger_output_dir))
outputFileName.set(swagger_output_name)
waitTimeInSeconds.set(30)
}
swaggerSources {
def client_dir = "$buildDir/clients"
TsFetch {
inputFile = file("$swagger_output_dir/$swagger_output_name")
code {
language = 'typescript-fetch'
configFile = file('client-config/ts-fetch.json')
// templateDir = file('client-config/typescript-fetch')
rawOptions = ["-e", "mustache"]
outputDir = file("$client_dir/ts-fetch-client")
}
}
CSharp {
inputFile = file("$swagger_output_dir/$swagger_output_name")
code {
language = 'csharp-netcore'
configFile = file('client-config/csharp-netcore.json')
outputDir = file("$client_dir/csharp-client")
// rawOptions = [
// "--type-mappings", "binary=System.IO.Stream"
// ]
}
}
Cpp {
inputFile = file("$swagger_output_dir/$swagger_output_name")
code {
language = 'cpp-restsdk'
configFile = file('client-config/cpp.json')
outputDir = file("$client_dir/cpp-client")
}
}
Rust {
inputFile = file("$swagger_output_dir/$swagger_output_name")
code {
language = 'rust'
configFile = file('client-config/rust.json')
outputDir = file("$client_dir/rust-client")
}
}
}
rootProject.afterEvaluate(){
def forkedSpringBootRun = project.tasks.named("forkedSpringBootRun")
forkedSpringBootRun.configure {
doNotTrackState("See https://github.com/springdoc/springdoc-openapi-gradle-plugin/issues/102")
}
}