forked from Swagger2Markup/spring-swagger2markup-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
130 lines (113 loc) · 3.93 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
//mavenLocal()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.3'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.10.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE'
classpath 'io.github.swagger2markup:swagger2markup-spring-restdocs-ext:1.2.0'
classpath 'io.github.swagger2markup:swagger2markup-gradle-plugin:1.2.0'
classpath "org.ajoberstar:gradle-git:1.5.1"
}
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'spring-boot'
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'io.github.swagger2markup'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'org.ajoberstar.github-pages'
version = '1.2.0'
group = 'io.github.swaggger2markup'
tasks.withType(JavaCompile) {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.deprecation = true
options.encoding = 'UTF-8'
options.compilerArgs << "-Xlint:unchecked"
}
repositories {
jcenter()
mavenCentral()
maven { url 'https://repo.spring.io/snapshot' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local/' }
mavenLocal()
}
ext {
asciiDocOutputDir = file("${buildDir}/asciidoc/generated")
swaggerOutputDir = file("${buildDir}/swagger")
snippetsOutputDir = file("${buildDir}/asciidoc/snippets")
springfoxVersion = '2.5.0'
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'io.swagger:swagger-annotations:1.5.6'
compile 'com.google.guava:guava:18.0'
compile 'net.logstash.logback:logstash-logback-encoder:4.5.1'
compile("com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.6.5")
compile("com.fasterxml.jackson.module:jackson-module-afterburner:2.6.5")
testCompile "io.springfox:springfox-swagger2:${springfoxVersion}"
testCompile "io.springfox:springfox-bean-validators:${springfoxVersion}"
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile 'junit:junit'
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
testCompile 'com.fasterxml.jackson.module:jackson-module-jsonSchema:2.6.5'
}
test {
systemProperty 'io.springfox.staticdocs.outputDir', swaggerOutputDir
systemProperty 'io.springfox.staticdocs.snippetsOutputDir', snippetsOutputDir
}
convertSwagger2markup {
dependsOn test
swaggerInput "${swaggerOutputDir}/swagger.json"
outputDir asciiDocOutputDir
config = [
'swagger2markup.pathsGroupedBy' : 'TAGS',
'swagger2markup.extensions.springRestDocs.snippetBaseUri': snippetsOutputDir.getAbsolutePath()]
}
asciidoctor {
dependsOn convertSwagger2markup
sources {
include 'index.adoc'
}
backends = ['html5', 'pdf']
attributes = [
doctype: 'book',
toc: 'left',
toclevels: '3',
numbered: '',
sectlinks: '',
sectanchors: '',
hardbreaks: '',
generated: asciiDocOutputDir
]
}
publishGhPages.dependsOn asciidoctor
githubPages {
repoUri = 'https://github.com/Swagger2Markup/spring-swagger2markup-demo.git'
credentials {
username = project.hasProperty('githubUser') ? project.githubUser : System.getenv('GITHUB_USER')
password = project.hasProperty('githubPassword') ? project.githubPassword : System.getenv('GITHUB_PASSWORD')
}
pages {
from file(asciidoctor.outputDir.path + '/html5')
into project.version
}
}
jar {
dependsOn asciidoctor
from ("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
from ("${asciidoctor.outputDir}/pdf") {
into 'static/docs'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.12'
}