-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
191 lines (153 loc) · 6.23 KB
/
build.xml
File metadata and controls
191 lines (153 loc) · 6.23 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<project name="proxool-doc" default="generate.website" basedir=".">
<!-- ======================== Configuration =========================== -->
<property name="app.name" value="proxool-docs"/>
<property name="app.version" value="X.X"/>
<property name="src.home" value="src"/>
<property name="src.docs" value="${src.home}/docs"/>
<property name="src.website" value="${src.home}/website"/>
<property name="src.website.xslt" value="${src.home}/website/xslt"/>
<property name="lib.home" value="lib"/>
<property name="build.home" value="build"/>
<property name="build.web.src" value="${build.home}/website-src"/>
<property name="build.website" value="${build.home}/website"/>
<property file="build.properties"/>
<property name="xslt.forcefalse" value="false"/>
<!-- ======================== DTD Configuration ======================= -->
<property name="docbook.dtd.version" value="4.2"/>
<property name="docbook.xsl.version" value="1.60.1"/>
<property name="website.version" value="2.5.0"/>
<xmlcatalog id="docbook">
<dtd publicId="-//OASIS//DTD DocBook XML V${docbook.dtd.version}//EN"
location="${build.home}/docbook-dtd-${docbook.dtd.version}/docbookx.dtd"/>
</xmlcatalog>
<xmlcatalog id="website">
<xmlcatalog refid="docbook"/>
<catalogpath>
<fileset
dir="${build.home}"
includes="catalog.xml"/>
</catalogpath>
</xmlcatalog>
<!-- ======================== Target: Prepare ========================= -->
<target name="prepare"
description="Prepares the project build environment.">
<!-- Make the build directory -->
<mkdir dir="${build.home}"/>
<!-- Make the catalog file for website -->
<echo file="${build.home}/catalog.xml">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI
uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
rewritePrefix="docbook-xsl-${docbook.xsl.version}/"/>
<rewriteURI
uriStartString="http://docbook.sourceforge.net/release/website/"
rewritePrefix="website-${website.version}/xsl/"/>
</catalog>
</echo>
<!-- Unzip the Dobbook XSLT and DTD archives to the build director -->
<unzip src="${lib.home}/docbook-xml-${docbook.dtd.version}.zip"
dest="${build.home}/docbook-dtd-${docbook.dtd.version}"
overwrite="false"
/>
<unzip src="${lib.home}/docbook-xsl-${docbook.xsl.version}.zip"
dest="${build.home}"
overwrite="false"
/>
<unzip src="${lib.home}/website-${website.version}.zip"
dest="${build.home}"
overwrite="false"
/>
</target>
<!-- ======================== Target: Clean =========================== -->
<target name="clean"
description="Cleans the project build environment.">
<delete dir="${build.home}"/>
</target>
<!-- ======================== Target: Generate ======================== -->
<target name="generate"
depends="generate.docbook-html, generate.website"
description="Generates all documentation formats.">
</target>
<!-- ================== Generate.Website dependencies =================== -->
<target name="generate.website-src" depends="validate"
description="Converts articles and books into webpages" >
<xslt basedir="${src.docs}"
style="${src.website.xslt}/website-src.xsl"
includes="*.xml"
extension=".xml"
destdir="${build.home}/website-src">
<xmlcatalog refid="docbook"/>
</xslt>
</target>
<target name="generate.website-autolayout"
description="Generates the autolayout file used in the Website generation"
>
<copy todir="${build.web.src}" file="${src.website}/layout.xml"/>
<xslt basedir="${build.web.src}"
in="${build.web.src}/layout.xml"
out="${build.web.src}/autolayout.xml"
style="${build.home}/website-${website.version}/xsl/autolayout.xsl">
<xmlcatalog refid="docbook"/>
</xslt>
</target>
<!-- ======================= Target: Generate.Website ======================= -->
<target name="generate.website" depends="generate.website-src, generate.website-autolayout"
description="Generates the HTML website using the Website Tabular style"
>
<xslt
basedir="${build.web.src}"
style="${src.website.xslt}/website.xsl"
includes="autolayout.xml"
destdir="${build.website}"
extension=".html"
followsymlinks="false"
>
<xmlcatalog refid="website"/>
</xslt>
<copy todir="${build.website}">
<!-- documentation images -->
<fileset dir="${src.docs}">
<include name="images/**"/>
</fileset>
<!-- website-specific stuff -->
<fileset dir="${src.website}">
<include name="proxool.css"/>
<include name="webimages/**"/>
</fileset>
<!-- very helpful images which came with website -->
<fileset dir="${build.home}/website-${website.version}/example">
<include name="graphics/**"/>
</fileset>
</copy>
</target>
<!-- ================== Target: Generate.Docbook ================= -->
<target name="generate.docbook-html"
depends="validate"
description="Generates HTML documentation using the standard DocBook stylesheet.">
<xslt basedir="${src.docs}"
includes="*.xml"
destdir="${build.home}/docbook-html"
extension=".html"
force="${xslt.force}"
style="${build.home}/docbook-xsl-${docbook.xsl.version}/html/docbook.xsl">
<xmlcatalog refid="docbook"/>
</xslt>
<copy todir="${build.home}/docbook-html">
<fileset dir="${src.docs}">
<exclude name="**/*.xml"/>
</fileset>
</copy>
</target>
<!-- ======================== Target: Validate ===================== -->
<target name="validate"
depends="prepare"
description="Checks the XML source to ensure that it is well-formed and valid.">
<!-- Validate the docbook files -->
<xmlvalidate>
<fileset dir="${src.docs}">
<include name="**/*.xml"/>
</fileset>
<xmlcatalog refid="docbook"/>
</xmlvalidate>
</target>
</project>