-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
75 lines (62 loc) · 1.41 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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.9.2'
}
}
def docVersion = '7.2'
apply plugin: 'org.asciidoctor.convert'
asciidoctor {
sourceDir = file('adoc')
sources {
include 'en/restapi.adoc'
include 'ru/restapi.adoc'
}
outputDir = file('build')
attributes 'revnumber': docVersion
}
asciidoctor.doLast {
copy {
from 'img'
into 'build/html5/en/img'
}
copy {
from 'img'
into 'build/html5/ru/img'
}
copy {
from 'styles'
into 'build/html5/en/styles'
}
copy {
from 'styles'
into 'build/html5/ru/styles'
}
copy {
from 'js'
into 'build/html5/en/js'
}
copy {
from 'js'
into 'build/html5/ru/js'
}
}
build.dependsOn(asciidoctor)
build.doLast {
def tmpDir = new File(buildDir, "tmp/war/restapi")
copy {
from "$buildDir/html5/en"
into tmpDir
rename 'restapi.html', 'index.html'
}
ant.jar(destfile: "$buildDir/war/restapi-${docVersion}.war", basedir: tmpDir)
def tmpRuDir = new File(buildDir, "tmp/war/restapi-ru")
copy {
from "$buildDir/html5/ru"
into tmpRuDir
rename 'restapi.html', 'index.html'
}
ant.jar(destfile: "$buildDir/war/restapi-${docVersion}-ru.war", basedir: tmpRuDir)
}