-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
108 lines (92 loc) · 2.85 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
plugins {
id 'org.asciidoctor.jvm.convert' version '4.0.3'
id 'org.asciidoctor.jvm.gems' version '4.0.3'
id 'com.stehno.gradle.webpreview' version '0.3.0'
}
group = 'io.github.cjstehno.ersatz'
version = '4.0.1'
repositories {
mavenCentral()
}
asciidoctor {
baseDir file('src/docs/asciidoc')
options doctype: 'book'
attributes(
'source-highlighter': 'rouge',
'coderay-linenums-mode': 'table',
icon: 'font',
linkattrs: true,
encoding: 'utf-8'
)
}
webPreview {
resourceDir = file('build/site')
}
task site(dependsOn: ['build', 'ersatz:javadoc', 'ersatz:jacocoTestReport', 'ersatz-groovy:javadoc', 'ersatz-groovy:jacocoTestReport', 'asciidoctor']) {
doLast {
def vars = [
project_version: project.version,
year : Calendar.instance.get(Calendar.YEAR)
]
mkdir 'build/site'
copy {
from 'src/site'
into 'build/site'
include '**/*.html'
expand vars
}
copy {
from 'src/site'
into 'build/site'
include '**/css/**'
include '**/js/**'
include '**/img/**'
}
// Copy the ersatz coverage reports
copy {
from 'ersatz/build/reports/jacoco/test/html'
include '**/**'
into 'build/site/ersatz/jacoco'
}
// Copy the ersatz test reports
copy {
from 'ersatz/build/reports/tests/test'
include '**/**'
into 'build/site/ersatz/tests'
}
// Copy the ersatz javadocs
copy {
from 'ersatz/build/docs/javadoc'
include '**/**'
into 'build/site/ersatz/javadoc'
}
// Copy the ersatz-groovy coverage reports
copy {
from 'ersatz-groovy/build/reports/jacoco/test/html'
include '**/**'
into 'build/site/ersatz-groovy/jacoco'
}
// Copy the ersatz-groovy test reports
copy {
from 'ersatz-groovy/build/reports/tests/test'
include '**/**'
into 'build/site/ersatz-groovy/tests'
}
// Copy the ersatz-groovy javadocs
copy {
from 'ersatz-groovy/build/docs/javadoc'
include '**/**'
into 'build/site/ersatz-groovy/javadoc'
}
// copy the generated user-guide
copy {
from 'build/docs/asciidoc'
include 'user_guide.html'
into 'build/site/docs'
}
}
}
task publishSite(type: GradleBuild, group: 'Publishing', description: 'Publishes the documentation web site.', dependsOn: ['site']) {
buildFile = 'publish.gradle'
tasks = ['gitPublishPush']
}