This repository has been archived by the owner on Jan 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
62 lines (56 loc) · 1.75 KB
/
build.xml
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
<project name="BND Book" default="publish" basedir=".">
<property environment="env"/>
<property name="pub-dir" value="target/docs/"/>
<property name="src-dir" value="docs/"/>
<property name="pamflet.exe" value="${user.home}/bin/pf"/>
<target name="clean">
<delete file="bnd-book.war"/>
<mkdir dir="${pub-dir}"/>
<delete dir="${pub-dir}"/>
<mkdir dir="${pub-dir}"/>
</target>
<target name="props" depends="clean">
<!-- Append build info to template.properties - makes them available to Markdown -->
<propertyfile file="${src-dir}/template.properties">
<entry key="version" value="1.0"/>
<entry key="build_number" value="${env.BUILD_NUMBER}"/>
<entry key="build_id" value="${env.BUILD_ID}"/>
<entry key="build_date" type="date" value="now" pattern="dd MMM yyyy"/>
<entry key="build_time" type="date" value="now" pattern="HH:mm (zzz)"/>
</propertyfile>
</target>
<target name="init">
<copy todir="${pub-dir}">
<fileset dir="${src-dir}">
<include name="img/*"/>
</fileset>
</copy>
</target>
<target name="publish" depends="clean,init,props">
<exec executable="${pamflet.exe}">
<arg value="${src-dir}"/>
<arg value="${pub-dir}"/>
</exec>
</target>
<target name="epub" depends="publish">
<exec executable="pandoc">
<arg value="-f"/>
<arg value="html"/>
<arg value="-t"/>
<arg value="epub"/>
<arg value="-o"/>
<arg value="bnd-book.epub"/>
<arg value="${pub-dir}/Combined+Pages.html"/>
</exec>
</target>
<target name="war" depends="init">
<war destfile="bnd-book.war" needxmlfile="false">
<fileset dir="${pub-dir}">
<include name="**/*.png"/>
<include name="**/*.html"/>
<include name="**/*.css"/>
<include name="**/*.js"/>
</fileset>
</war>
</target>
</project>