-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
58 lines (49 loc) · 1.68 KB
/
Copy pathbuild.gradle
File metadata and controls
58 lines (49 loc) · 1.68 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
plugins {
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'java'
id "org.openapi.generator" version "5.3.0"
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.openapitools:jackson-databind-nullable:0.2.1'
compileOnly 'io.swagger:swagger-annotations:1.6.5'
compileOnly 'org.projectlombok:lombok'
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}
task buildApiDoc(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
generatorName = "html2"
inputSpec = "$rootDir/src/main/resources/api-schema.yaml".toString()
outputDir = "$buildDir/apidoc".toString()
}
task buildSpringServer(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
generatorName = "spring"
inputSpec = "$rootDir/src/main/resources/api-schema.yaml".toString()
outputDir = "$buildDir/spring".toString()
apiPackage = "com.example.todoapi.controller"
modelPackage = "com.example.todoapi.model"
configOptions = [
interfaceOnly: "true"
]
}
compileJava.dependsOn tasks.buildSpringServer
sourceSets.main.java.srcDir "$buildDir/spring/src/main/java"