This repository has been archived by the owner on May 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
114 lines (94 loc) · 3.39 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
buildscript {
ext {
springBootVersion = '2.0.9.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'org.springframework.boot' version "${springBootVersion}"
id 'org.hidetake.swagger.generator' version '2.16.0'
}
defaultTasks 'clean', 'build', 'jar'
group 'io.github.yuokada'
version '1.0-SNAPSHOT'
apply plugin: 'groovy'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
targetCompatibility = 1.8
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.11'
// swaggerCodegen 'io.swagger:swagger-codegen-cli:2.3.1'
swaggerCodegen 'io.swagger.codegen.v3:swagger-codegen-cli:3.0.3'
swaggerUI 'org.webjars:swagger-ui:3.10.0'
compile 'io.springfox:springfox-swagger2:2.7.0'
compile 'org.springframework.boot:spring-boot-starter-web:2.0.2.RELEASE'
compile 'org.springframework.boot:spring-boot-starter-tomcat:2.0.2.RELEASE'
compile 'io.springfox:springfox-swagger2:2.7.0'
compile 'io.springfox:springfox-swagger-ui:2.7.0'
compile('org.springframework.boot:spring-boot-starter-cache')
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-jdbc')
// compile('org.springframework.boot:spring-boot-starter-security')
compile('org.springframework.boot:spring-boot-starter-thymeleaf')
compile('org.springframework.boot:spring-boot-starter-validation')
compile('org.springframework.boot:spring-boot-devtools')
runtime('org.springframework.boot:spring-boot-devtools')
runtime('com.h2database:h2')
runtime('mysql:mysql-connector-java')
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
compile group: 'io.swagger', name: 'swagger-annotations', version: '1.5.20'
compile 'com.fasterxml.jackson.core:jackson-databind:2.9.6'
testCompile 'junit:junit:4.12'
}
swaggerSources {
tweet {
inputFile = file('src/main/resources/swagger/tweet.yaml')
code {
language = 'spring'
configFile = file('src/main/resources/swagger/config.json')
outputDir = file('output')
wipeOutputDir = false
// Generate only models and controllers
// components = ['models', 'apis']
dependsOn validation
doLast {
copy {
from "${code.outputDir}/src/main/java/io/github/yuokada/swagger/demoapi"
// from 'output/src/main/java/io/github/yuokada/swagger/demoapi/impl/*.java'
into "src/main/java/io/github/yuokada/swagger/demoapi"
}
}
}
ui {
outputDir = file("docs")
}
}
ktweet {
inputFile = file('src/main/resources/swagger/tweet.yaml')
code {
language = 'kotlin-server'
configFile = file('src/main/resources/swagger/kotlin-server.json')
outputDir = file('output')
wipeOutputDir = false
dependsOn validation
doLast {
copy {
from "${code.outputDir}/src/main/kotlin/io/github/yuokada/swagger/demoapi"
into "src/main/kotlin/io/github/yuokada/swagger/demoapi"
}
}
}
}
}
// ref: https://github.com/int128/gradle-swagger-generator-plugin
// ref: https://github.com/int128/gradle-swagger-generator-plugin/blob/c95c62deba438a4ee10206fee601e46accf8f8c9/acceptance-test/code-generator/build.gradle#L28-L30