forked from spring-projects/spring-restdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
69 lines (61 loc) · 1.64 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
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
}
repositories {
maven { url 'https://repo.spring.io/release' }
maven { url 'https://repo.spring.io/snapshot' }
}
ext {
docResourcesVersion = '0.1.0.RELEASE'
}
dependencies {
asciidoctor 'io.spring.asciidoctor:spring-asciidoctor-extensions:0.1.2.RELEASE'
testCompile project(':spring-restdocs-mockmvc')
testCompile project(':spring-restdocs-restassured')
testCompile project(':spring-restdocs-webtestclient')
testCompile 'io.rest-assured:rest-assured'
testCompile 'javax.validation:validation-api'
testCompile 'junit:junit'
testCompile 'org.testng:testng:6.9.10'
testCompile 'org.junit.jupiter:junit-jupiter-api'
}
tasks.findByPath("artifactoryPublish")?.enabled = false
configurations {
docs
}
dependencies {
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
from {
configurations.docs.collect { zipTree(it) }
}
from 'src/docs/asciidoc/'
into "$buildDir/asciidoc"
}
asciidoctor {
dependsOn 'prepareAsciidocBuild'
sourceDir "$buildDir/asciidoc"
sources {
include 'index.adoc'
}
resources {
from(sourceDir) {
include 'images/*', 'css/*', 'js/**'
}
}
options doctype: 'book'
attributes 'revnumber': project.version,
'icons': 'font',
docinfo: 'shared',
stylesdir: 'css/',
stylesheet: 'spring.css',
'linkcss': true,
sectanchors: true,
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable',
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'master': "v${project.version}"
inputs.files(sourceSets.test.java)
}