1 <?xml version="1.0" encoding="UTF-8"?>
4 Building 'The Definitive Guide' - html
7 Building 'The Definitive Guide' - pdf
16 *) RELAX NG Support(jing)
19 *) python-libxml2 2.6.32 (Line number in the pot file is inaccurate if XML
20 file larger than 65535 lines, See:
21 http://bugzilla.gnome.org/show_bug.cgi?id=325533)
23 *) xep 4.1.4 or fop trunk 2008-12-19(r728025), pdf only
24 *) chinese font files, pdf only
26 <project name="defguide" default="html">
28 <property file="build.properties"/>
30 <path id="lib.classpath">
31 <fileset dir="${ant.home}/lib">
32 <include name="*.jar"/>
34 <fileset dir="${fop.home}">
35 <include name="**/*.jar"/>
37 <fileset dir="${usr.share.java}">
38 <include name="**/*.jar"/>
40 <pathelement location="${usr.share.java}"/>
43 <path id="xep.classpath">
44 <fileset dir="${xep.home}/lib">
45 <include name="*.jar"/>
49 <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
52 <echo message="Use the -projecthelp option instead"/>
55 <target name="clean" description="Clean the build directory">
59 <target name="init" description="Check runtime configuration">
60 <echo message="java.version: ${java.version}"/>
62 <!--Java SE 1.4 & 1.5: Unfixed java.lang.StackOverflowError !-->
64 <condition property="jdk_ok">
65 <scriptcondition language="beanshell" value="true">
67 jvm = System.getProperty("java.specification.version");
68 if(jvm.compareTo("1.6") < 0)
73 <fail unless="jdk_ok">
80 <not><available file="build.properties"/></not>
82 Please create your build.properties from build.properties.tmpl !
87 <not><available classname="com.thaiopensource.relaxng.util.Driver"/></not>
89 RELAX NG Support(jing) NOT Present !
94 <not><available classname="com.icl.saxon.StyleSheet" classpathref="lib.classpath"/></not>
96 Saxon 6.5 Support NOT Present !
100 <target name="validate" depends="init" description="Validate document">
101 <jing rngfile="${docbook5.home}/rng/docbook.rng" file="source/defguide.xml"/>
102 <!--Don't uncomment this unless xml2po support namespace !-->
103 <!--jing rngfile="${docbook5.home}/rng/docbook.rng"
104 file="build/defguide-zh.xml"/-->
107 <target name="all" description="Generate document - pdf,html">
108 <antcall target="defguide"/>
109 <antcall target="pdf"/>
110 <antcall target="html"/>
113 <target name="po.init">
114 <uptodate property="po.isUpToDate" targetfile="po/zh.po">
115 <srcfiles dir="source" includes="defguide.xml"/>
119 <!-- Total time: 29 minutes 30 seconds -->
120 <target name="updatepo" depends="po.init" unless="po.isUpToDate" description="Update PO file">
121 <echo message="Making defguide.pot ..."/>
122 <exec dir="${basedir}/po" executable="python" failonerror="true">
123 <arg value="../xml2po/xml2po.py"/>
125 <arg value="defguide.pot"/>
126 <arg value="../source/defguide.xml"/>
129 <echo message="Merging zh.po ..."/>
130 <exec dir="${basedir}" executable="msgmerge">
131 <arg value="--sort-by-file"/>
132 <arg value="--width=80"/>
134 <arg value="po/zh.po.new"/>
135 <arg value="po/zh.po"/>
136 <arg value="po/defguide.pot"/>
138 <move file="po/zh.po.new" tofile="po/zh.po"/>
141 <target name="translate.init" depends="updatepo">
142 <uptodate property="translate.isUpToDate" targetfile="build/defguide-zh.xml">
143 <srcfiles dir="source" includes="defguide.xml"/>
144 <srcfiles dir="po" includes="zh.po"/>
148 <!-- Total time: 29 minutes 14 seconds -->
149 <target name="translate" depends="translate.init" unless="translate.isUpToDate" description="Translate document">
151 <echo message="Translating defguide-zh.xml ..."/>
152 <exec dir="${basedir}/xml2po" executable="python" failonerror="true">
153 <arg value="xml2po.py"/>
157 <arg value="../po/zh.po"/>
159 <arg value="../build/defguide-zh.xml"/>
160 <arg value="../source/defguide.xml"/>
162 <delete file="xml2po/.xml2po.mo"/>
165 <target name="html.init">
166 <uptodate property="html.isUpToDate" targetfile="build/html/.done">
167 <srcfiles dir="source" includes="defguide.xml"/>
168 <srcfiles dir="po" includes="zh.po"/>
169 <srcfiles dir="stylesheets" includes="html.xsl"/>
170 <srcfiles dir="stylesheets/zh" includes="html.xsl"/>
174 <!-- Total time: 13 minutes 48 seconds -->
175 <target name="html" depends="init,translate,html.init" unless="html.isUpToDate" description="Generate document - html">
176 <mkdir dir="build/schema"/>
177 <copy todir="build/schema">
178 <fileset dir="source/schema"/>
180 <copy todir="build/html/images">
181 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
183 <copy todir="build/html/figures">
184 <fileset dir="source/figures"/>
186 <copy todir="build/examples">
187 <fileset dir="../en/examples"/>
190 <echo message="Making html ..."/>
191 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
192 failonerror="true" dir="${basedir}/build/html">
193 <jvmarg value="-Xss512k"/>
194 <classpath refid="lib.classpath"/>
196 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
198 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
200 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
201 <arg value="../defguide-zh.xml"/>
202 <arg value="../../stylesheets/zh/html.xsl"/>
204 <!--exec dir="${basedir}/build/html" executable="xsltproc" failonerror="true">
205 <arg value="- -nonet"/>
206 <arg value="../../stylesheets/zh/html.xsl"/>
207 <arg value="../defguide-zh.xml"/>
209 <touch file="build/html/.done"/>
212 <target name="pdf.init">
213 <uptodate property="pdf.isUpToDate" targetfile="build/defguide-zh.pdf">
214 <srcfiles dir="source" includes="defguide.xml"/>
215 <srcfiles dir="po" includes="zh.po"/>
216 <srcfiles dir="stylesheets" includes="fo.xsl"/>
217 <srcfiles dir="stylesheets/zh" includes="fo.xsl"/>
221 <!-- Total time: 10 minutes 44 seconds -->
222 <target name="pdf" depends="init,translate,pdf.init" unless="pdf.isUpToDate" description="Generate document - pdf">
223 <mkdir dir="build/schema"/>
224 <copy todir="build/schema">
225 <fileset dir="source/schema"/>
227 <copy todir="build/images">
228 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
230 <copy todir="build/figures">
231 <fileset dir="source/figures" />
233 <copy todir="build/examples">
234 <fileset dir="../en/examples"/>
237 <echo message="Making fo ..."/>
238 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
239 failonerror="true" dir="${basedir}/build">
240 <jvmarg value="-Xss512k"/>
241 <classpath refid="lib.classpath"/>
243 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
245 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
247 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
249 <arg value="defguide-zh.fo"/>
250 <arg value="defguide-zh.xml"/>
251 <arg value="../stylesheets/zh/fo.xsl"/>
252 <arg value="fop1.extensions=1"/>
253 <arg value="title.font.family=${fop.title.font.family}"/>
254 <arg value="body.font.family=${fop.body.font.family}"/>
255 <arg value="sans.font.family=${fop.sans.font.family}"/>
256 <arg value="ingbat.font.family=${fop.ingbat.font.family}"/>
257 <arg value="monospace.font.family=${fop.monospace.font.family}"/>
260 <echo message="Making pdf ..."/>
261 <java classname="${fop.class}" fork="true" maxmemory="1024m"
262 failonerror="true" dir="${basedir}/build">
263 <classpath refid="lib.classpath"/>
265 <arg value="${fop.home}/conf/userconfig.xml"/>
266 <arg value="defguide-zh.fo"/>
267 <arg value="defguide-zh.pdf"/>
271 <!-- Total time: ?? minutes ?? seconds -->
272 <target name="pdf-xep" depends="init,translate,pdf.init" unless="pdf.isUpToDate" description="Generate document - pdf - xep">
273 <mkdir dir="build/schema"/>
274 <copy todir="build/schema">
275 <fileset dir="source/schema"/>
277 <copy todir="build/images">
278 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
280 <copy todir="build/figures">
281 <fileset dir="source/figures" />
283 <copy todir="build/examples">
284 <fileset dir="../en/examples"/>
287 <echo message="Making fo ..."/>
288 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
289 failonerror="true" dir="${basedir}/build">
290 <jvmarg value="-Xss1m"/>
291 <classpath refid="lib.classpath"/>
293 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
295 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
297 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
299 <arg value="defguide-zh.fo"/>
300 <arg value="defguide-zh.xml"/>
301 <arg value="../stylesheets/zh/fo.xsl"/>
302 <arg value="xep.extensions=1"/>
305 <echo message="Making pdf ..."/>
306 <java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m"
307 failonerror="true" dir="${basedir}/build">
308 <jvmarg value="-Xss512k"/>
309 <classpath refid="xep.classpath"/>
310 <arg value="-DCONFIG=${xep.home}/xep.xml"/>
311 <arg value="-quiet"/>
312 <arg value="defguide-zh.fo"/>
313 <arg value="defguide-zh.pdf"/>
317 <target name="defguide.init">
318 <uptodate property="defguide.isUpToDate" targetfile="build/defguide.pdf">
319 <srcfiles dir="source" includes="defguide.xml"/>
323 <!-- Total time: 12 minutes 41 seconds -->
324 <target name="defguide" depends="init,defguide.init" unless="defguide.isUpToDate" description="Generate document - defguide(en)">
325 <mkdir dir="build/schema"/>
326 <copy todir="build/schema">
327 <fileset dir="source/schema"/>
329 <copy todir="build/images">
330 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
332 <copy todir="build/figures">
333 <fileset dir="source/figures" />
335 <copy todir="build/examples">
336 <fileset dir="../en/examples"/>
338 <copy file="source/defguide.xml" todir="build"/>
340 <echo message="Making fo ..."/>
341 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
342 failonerror="true" dir="${basedir}/build">
343 <jvmarg value="-Xss512k"/>
344 <classpath refid="lib.classpath"/>
346 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
348 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
350 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
352 <arg value="defguide.fo"/>
353 <arg value="defguide.xml"/>
354 <arg value="../stylesheets/fo.xsl"/>
355 <arg value="fop1.extensions=1"/>
356 <arg value="title.font.family=${fop.title.font.family}"/>
357 <arg value="body.font.family=${fop.body.font.family}"/>
358 <arg value="sans.font.family=${fop.sans.font.family}"/>
359 <arg value="ingbat.font.family=${fop.ingbat.font.family}"/>
360 <arg value="monospace.font.family=${fop.monospace.font.family}"/>
363 <echo message="Making pdf ..."/>
364 <java classname="${fop.class}" fork="true" maxmemory="1024m"
365 failonerror="true" dir="${basedir}/build">
366 <classpath refid="lib.classpath"/>
368 <arg value="${fop.home}/conf/userconfig.xml"/>
369 <arg value="defguide.fo"/>
370 <arg value="defguide.pdf"/>
374 <!-- Total time: ?? minutes ?? seconds -->
375 <target name="defguide-xep" depends="init,defguide.init" unless="defguide.isUpToDate" description="Generate document - defguide(en) - xep">
376 <copy todir="build/schema">
377 <fileset dir="source/schema"/>
379 <copy todir="build/images">
380 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
382 <copy todir="build/figures">
383 <fileset dir="source/figures" />
385 <copy todir="build/examples">
386 <fileset dir="../en/examples"/>
388 <copy file="source/defguide.xml" todir="build"/>
390 <echo message="Making fo ..."/>
391 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
392 failonerror="true" dir="${basedir}/build">
393 <jvmarg value="-Xss512k"/>
394 <classpath refid="lib.classpath"/>
396 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
398 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
400 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
402 <arg value="defguide.fo"/>
403 <arg value="defguide.xml"/>
404 <arg value="../stylesheets/fo.xsl"/>
405 <arg value="xep.extensions=1"/>
408 <echo message="Making pdf ..."/>
409 <java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m"
410 failonerror="true" dir="${basedir}/build">
411 <jvmarg value="-Xss512k"/>
412 <classpath refid="xep.classpath"/>
413 <arg value="-DCONFIG=${xep.home}/xep.xml"/>
414 <arg value="-quiet"/>
415 <arg value="defguide.fo"/>
416 <arg value="defguide.pdf"/>