-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
59 lines (49 loc) · 1.66 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
import java.nio.file.Paths
plugins {
id 'java'
id 'idea'
id 'org.springframework.boot' version '2.1.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.6.RELEASE'
id "org.openapi.generator" version "4.1.0"
}
group 'github.com/jasonzguo'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-data-mongodb'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.mapstruct:mapstruct:1.3.0.Final'
compile "io.springfox:springfox-swagger2:2.9.2"
compile group: 'org.openapitools', name: 'jackson-databind-nullable', version: '0.2.0'
testCompile group: 'junit', name: 'junit', version: '4.12'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.3.0.Final'
}
// Tasks
task dropMongoIndexes(type:Exec) {
commandLine 'mongo', 'dropIndexes.js'
}
task echoJavaHome(type: Exec) {
commandLine 'sh', '-c', 'ls'
}
// Task Configurations
openApiGenerate {
generatorName = 'spring'
inputSpec = Paths.get("${projectDir}", "src", "main", "resources", "specs", "api.yaml").toString()
outputDir = Paths.get("${buildDir}", "generated").toString()
invokerPackage = 'com.github.jasonzguo.openapidemo'
apiPackage = 'com.github.jasonzguo.openapidemo.api'
modelPackage = 'com.github.jasonzguo.openapidemo.model'
configOptions = [
interfaceOnly: true
]
}
// Task Dependencies
compileJava.dependsOn {
tasks.dropMongoIndexes
}
sourceSets.main.java.srcDirs = ['build/generated/src/main/java', 'src/main/java']