-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
150 lines (119 loc) · 4.3 KB
/
Copy pathbuild.gradle
File metadata and controls
150 lines (119 loc) · 4.3 KB
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
import org.hidetake.gradle.swagger.generator.GenerateSwaggerUI
buildscript {
ext {
restdocsApiSpecVersion = '0.19.0'
jjwtVersion = '0.11.5'
}
}
plugins {
id 'java'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
id 'com.epages.restdocs-api-spec' version "${restdocsApiSpecVersion}"
id 'org.hidetake.swagger.generator' version '2.19.2'
}
group = 'org.crops'
version = '0.0.1-SNAPSHOT'
swaggerSources {
fit {
setInputFile(file("${project.buildDir}/api-spec/openapi3.yaml"))
}
}
bootJar {
archivesBaseName = 'app'
archiveFileName = 'app.jar'
enabled = true
}
jar { enabled = false }
java {
sourceCompatibility = '17'
}
repositories {
mavenCentral()
}
configurations {
querydslApt
compileOnly {
extendsFrom annotationProcessor
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
implementation 'com.h2database:h2'
// Redis
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
// QueryDSL
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
implementation "io.github.openfeign.querydsl:querydsl-core:6.1"
implementation 'io.github.openfeign.querydsl:querydsl-jpa:6.1'
annotationProcessor "jakarta.annotation:jakarta.annotation-api"
annotationProcessor "jakarta.persistence:jakarta.persistence-api"
// for undefined value in json
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
// open feign
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign:4.0.3'
// jwt
runtimeOnly "io.jsonwebtoken:jjwt-impl:${jjwtVersion}"
runtimeOnly "io.jsonwebtoken:jjwt-jackson:${jjwtVersion}"
implementation "io.jsonwebtoken:jjwt-api:${jjwtVersion}"
// aws
implementation 'software.amazon.awssdk:s3:2.21.22'
// socket io
implementation 'com.corundumstudio.socketio:netty-socketio:1.7.19'
// email
implementation 'org.springframework.boot:spring-boot-starter-mail'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation "com.epages:restdocs-api-spec:${restdocsApiSpecVersion}"
swaggerUI 'org.webjars:swagger-ui:5.9.0'
testImplementation 'org.mockito:mockito-core'
testImplementation 'org.mockito:mockito-junit-jupiter'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
// commons
implementation 'org.apache.commons:commons-lang3:3.14.0'
}
openapi3 {
setServer(System.getProperty('env', 'local').startsWith("local") ? "http://localhost:8080" : "http://dev-api.f-it.team")
setTitle('Crops API')
setDescription('Crops API Docs')
setVersion(version)
setFormat('yaml')
}
tasks.withType(GenerateSwaggerUI).configureEach {
dependsOn('openapi3')
}
tasks.register('copySwaggerUI', Copy) {
dependsOn('generateSwaggerUIFit')
def generatedSwaggerUIFitTask = tasks.named('generateSwaggerUIFit', GenerateSwaggerUI).get()
from("${generatedSwaggerUIFitTask.outputDir}")
into(layout.buildDirectory.dir("resources/main/static/docs").get())
}
tasks.named('resolveMainClassName') {
dependsOn('copySwaggerUI')
}
tasks.withType(Jar).configureEach {
dependsOn('copySwaggerUI')
}
tasks.named('test') {
useJUnitPlatform()
systemProperty 'spring.profiles.active', System.getProperty("env", "test")
}
def querydslDir = layout.buildDirectory.dir("generated/querydsl").get().asFile
tasks.withType(JavaCompile) {
options.setGeneratedSourceOutputDirectory(file(querydslDir))
}
sourceSets {
main.java.srcDirs += [ querydslDir ]
}
clean.doLast {
file(querydslDir).deleteDir()
}