-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
86 lines (69 loc) · 2.52 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
// gradle build script to continuously translate asciidoctor documents into html;
// cd ~/DoctorPepper
// gradlew -t asciidoctor
// assumes you are running something like Dropbox or Google Drive, but also could be run locally
// from a second terminal session;
// All output html is written to gradle project folder named build/docs
// All input comes from the src/docs/asciidoc folder
// Task walker creates a toc.adoc file (table of contents) AFTER the asciidoctor task writes the *.html files to /build/docs
apply plugin: 'groovy'
apply plugin: 'org.asciidoctor.convert'
apply plugin: "jacoco"
defaultTasks 'asciidoctor' ,'walker'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
classpath group: 'org.asciidoctor', name: 'asciidoctorj-pdf', version: '1.5.0-alpha.16' // to support backends=['pdf']
}
}
// In this section you declare where to find the dependencies of your project
repositories {
jcenter()
}
// In this section you declare the dependencies for your production and test code
dependencies {
compile "org.codehaus.groovy:groovy-all:2.5.6"
runtime "org.codehaus.groovy:groovy-all:2.5.6"
// We use the awesome Spock testing and specification framework
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'junit:junit:4.12'
}
println "Gradle projectDir=${projectDir}"
asciidoctor {
sourceDir = projectDir //file("${projectDir}")
sourceDir = file("${projectDir}/src/docs")
outputDir = file('build/docs')
separateOutputDirs=false
backends = ['html5','pdf'] // if you don't want PDFs delete 'pdf'
resources {
from('src/resources/images') {}
into 'asciidoc/images'
}
attributes 'source-highlighter': 'coderay',
toc : 'right',
idprefix : '',
idseparator : '-'
} // end of asciidoctor
// runs our main() method; first arg points to a local folder path name to read thru; 2nd arg is output folder for toc.adoc summaty file
task(walker, dependsOn: 'classes', type: JavaExec) {
main = 'DocWalker'
classpath = sourceSets.main.runtimeClasspath
args "${projectDir}/build", "${projectDir}/src/docs/asciidoc"
}
// Code Coverage Tool
jacocoTestReport {
group = "Reporting"
reports {
xml.enabled true
csv.enabled false
//html.destination "${buildDir}/reports/coverage"
}
}
/*
task wrapper(type: Wrapper) {
gradleVersion = '5.3'
}
*/