-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
93 lines (83 loc) · 3.26 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
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.hidetake.swagger.generator' version '2.19.2'
id 'jacoco'
}
group = 'com.goolbitg'
version = '0.0.1-SNAPSHOT'
swaggerSources {
def typeMappings = 'URI=URI'
def importMappings = 'URI=java.net.URI'
goolbitg {
def apiYaml = "${rootDir}/src/main/resources/api/openapi.yaml"
def configJson = "${rootDir}/src/main/resources/api/config.json"
inputFile = file(apiYaml)
def ignoreFile = file("${rootDir}/src/main/resources/api/.openapi-generator-ignore")
code {
language = 'spring'
configFile = file(configJson)
rawOptions = ['--ignore-file-override', ignoreFile, '--type-mappings',
typeMappings, '--import-mappings', importMappings] as List<String>
components = [models: true, apis: true, supportingFiles: 'ApiUtil.java']
dependsOn validation
}
}
}
compileJava.dependsOn swaggerSources.goolbitg.code
sourceSets.main.java.srcDir "${swaggerSources.goolbitg.code.outputDir}/src/main/java"
sourceSets.main.resources.srcDir "${swaggerSources.goolbitg.code.outputDir}/src/main/resources"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
swaggerCodegen 'org.openapitools:openapi-generator-cli:6.2.1'
swaggerUI 'org.webjars:swagger-ui:3.52.5'
compileOnly 'io.swagger:swagger-annotations:1.6.4'
implementation 'org.springframework.boot:spring-boot-starter-validation'
compileOnly 'org.openapitools:jackson-databind-nullable:0.2.3'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'io.springfox:springfox-oas:3.0.0'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'com.h2database:h2'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
implementation 'com.auth0:java-jwt:4.3.0'
testImplementation 'org.springframework.security:spring-security-test'
implementation 'com.google.firebase:firebase-admin:9.4.3'
implementation 'mysql:mysql-connector-java:8.0.33'
implementation 'org.flywaydb:flyway-core:11.3.1'
implementation "org.flywaydb:flyway-mysql:11.3.1"
implementation 'software.amazon.awssdk:s3:2.30.17'
}
tasks.named('test') {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}
tasks.named('jacocoTestReport') {
dependsOn(tasks.test)
reports {
xml.required.set(true)
html.required.set(true)
}
}
build.dependsOn generateSwaggerUI
processResources {
dependsOn generateSwaggerCode
dependsOn generateSwaggerUI
from("${swaggerSources.goolbitg.ui.outputDir}") {
into 'static/swagger-ui'
}
}