-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
87 lines (75 loc) · 2.5 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
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 'io.github.swagger2markup:swagger2markup-gradle-plugin:1.3.1'
classpath "io.github.swagger2markup:swagger2markup:1.3.1"
classpath "io.github.swagger2markup:swagger2markup-import-files-ext:1.3.1"
classpath "com.bluepapa32:gradle-watch-plugin:0.1.5"
classpath "org.kordamp.gradle:livereload-gradle-plugin:0.2.1"
}
}
apply plugin: 'org.asciidoctor.convert'
apply plugin: 'com.bluepapa32.watch'
apply plugin: 'org.kordamp.gradle.livereload'
apply plugin: 'io.github.swagger2markup'
group 'io.github.swagger2markup'
version '1.3.1'
repositories {
jcenter()
mavenCentral()
}
ext {
asciiDocOutputDir = file("${buildDir}/asciidoc")
}
convertSwagger2markup {
swaggerInput file("src/docs/swagger/swagger_petstore.yaml").getAbsolutePath()
outputDir asciiDocOutputDir
config = ['swagger2markup.markupLanguage' : 'ASCIIDOC',
'swagger2markup.pathsGroupedBy' : 'TAGS',
'swagger2markup.extensions.dynamicDefinitions.contentPath' : file('src/docs/asciidoc/extensions/definitions').absolutePath,
'swagger2markup.extensions.dynamicOverview.contentPath' : file('src/docs/asciidoc/extensions/overview').absolutePath,
'swagger2markup.extensions.dynamicPaths.contentPath' : file('src/docs/asciidoc/extensions/paths').absolutePath,
'swagger2markup.extensions.dynamicSecurity.contentPath' : file('src/docs/asciidoc/extensions/security').absolutePath]
}
asciidoctorj {
version = '1.5.5'
}
asciidoctor {
dependsOn convertSwagger2markup
sources {
include 'index.adoc'
}
backends = ['html5', 'pdf']
attributes = [
doctype: 'book',
toc: 'left',
toclevels: '3',
numbered: '',
sectlinks: '',
sectanchors: '',
hardbreaks: '',
generated: asciiDocOutputDir
]
}
dependencies {
// add converters and extensions using `asciidoctor` configuration
asciidoctor 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.15'
}
watch {
asciidoc {
files fileTree('src/docs/asciidoc')
tasks 'asciidoctor'
}
}
liveReload {
docRoot asciidoctor.outputDir.canonicalPath
}
task wrapper(type: Wrapper) {
gradleVersion = '3.5'
}