-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
executable file
·82 lines (73 loc) · 1.54 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
plugins {
id 'base'
}
defaultTasks 'buildSite'
def unpackedSite = new File('build/unpacked')
def processedHTML = new File("build/xslt-result")
task copyTask(type: Copy) {
dependsOn(clean)
from 'src'
into unpackedSite
include '**/*.*'
}
task processHTML(dependsOn: 'copyTask') {
doLast() {
processedHTML.mkdirs()
ant {
xslt (
basedir: unpackedSite,
destdir: processedHTML,
style: "build-resources/display.xslt",
includes: "*.html",
) {
param (
name: 'timestamp',
expression: new Date().format("yyyy-MM-dd'T'HH:mmXXX")
)
}
}
}
}
task updateHTML(type: Copy) {
dependsOn(processHTML)
from (processedHTML)
into (unpackedSite)
include '*.html'
}
task makeRNC() {
dependsOn(copyTask)
doLast() {
ant.java(jar: trang_path, fork: true, failonerror: true, outputproperty: 'op1') {
arg(value:'src/validation/obfl.rng')
arg(value:new File(unpackedSite, 'validation/obfl.rnc'))
}
if (ant.properties.op1) {
println ant.properties.op1
}
}
}
task makeXSD() {
dependsOn(copyTask)
doLast() {
ant.java(jar: trang_path, fork: true, failonerror: true, outputproperty: 'op2') {
arg(value:'src/validation/obfl.rng')
arg(value: new File(unpackedSite, 'validation/obfl.xsd'))
}
if (ant.properties.op2) {
println ant.properties.op2
}
}
}
task zip(type: Zip) {
dependsOn(makeXSD, makeRNC, updateHTML)
from unpackedSite
}
task buildSite(type: Copy) {
dependsOn(zip)
from 'build/distributions'
from unpackedSite
into 'build/site'
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
}