-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
66 lines (56 loc) · 1.97 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
plugins {
id 'org.springframework.boot' version '2.5.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'org.hidetake.swagger.generator' version '2.18.2' //Swagger Generator Plugin for Gradle
id 'com.google.cloud.tools.jib' version '3.1.4' // google docker builder
}
group = 'ch.peiyuan'
version = '0.1.3'
sourceCompatibility = '11'
repositories {
mavenCentral()
}
swaggerSources {
badges {
inputFile = file("${rootDir}/src/main/resources/api/badges-api.yaml")
code {
language = 'spring'
configFile = file("${rootDir}/src/main/resources/api/config.json")
rawOptions = ['--ignore-file-override', file("${rootDir}/src/main/resources/api/.swagger-codegen-ignore")]
components = [models:true, apis: true,supportingFiles:"ApiUtil.java"]
}
ui {
outputDir = file("${rootDir}/docs")
wipeOutputDir = true
}
}
}
compileJava.dependsOn swaggerSources.badges.code
sourceSets.main.java.srcDir "${swaggerSources.badges.code.outputDir}/src/main/java"
sourceSets.main.resources.srcDir "${swaggerSources.badges.code.outputDir}/src/main/resources"
jib {
to {
image = 'puiiyuen/badge'
tags = [version]
}
container {
ports = ['8080']
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web:2.5.5'
testImplementation 'org.springframework.boot:spring-boot-starter-test:2.5.5'
//Swagger
swaggerCodegen 'org.openapitools:openapi-generator-cli:4.3.1'
swaggerUI 'org.webjars:swagger-ui:3.10.0'
compileOnly 'io.swagger:swagger-annotations:1.6.2'
//End of Swagger
compileOnly 'org.openapitools:jackson-databind-nullable:0.2.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
compileOnly 'org.springframework.boot:spring-boot-starter-validation'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
}
test {
useJUnitPlatform()
}