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 12 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"
150 description="Translate document">
152 <echo message="Translating defguide-zh.xml ..."/>
153 <exec dir="${basedir}/xml2po" executable="python" failonerror="true">
154 <arg value="xml2po.py"/>
158 <arg value="../po/zh.po"/>
160 <arg value="../build/defguide-zh.xml"/>
161 <arg value="../source/defguide.xml"/>
163 <delete file="xml2po/.xml2po.mo"/>
166 <target name="html.init">
167 <uptodate property="html.isUpToDate" targetfile="build/html/.done">
168 <srcfiles dir="source" includes="defguide.xml"/>
169 <srcfiles dir="po" includes="zh.po"/>
170 <srcfiles dir="stylesheets" includes="html.xsl"/>
171 <srcfiles dir="stylesheets/zh" includes="html.xsl"/>
175 <!-- Total time: 14 minutes 10 seconds -->
176 <target name="html" depends="init,translate,html.init" unless="html.isUpToDate"
177 description="Generate document - html">
178 <copy todir="build/schema">
179 <fileset dir="source/schema"/>
181 <copy todir="build/html/images">
182 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
184 <copy todir="build/html/figures">
185 <fileset dir="source/figures"/>
187 <copy todir="build/examples">
188 <fileset dir="../en/examples"/>
191 <echo message="Making html ..."/>
192 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
193 failonerror="true" dir="${basedir}/build/html">
194 <jvmarg value="-Xss512k"/>
195 <classpath refid="lib.classpath"/>
197 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
199 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
201 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
202 <arg value="../defguide-zh.xml"/>
203 <arg value="../../stylesheets/zh/html.xsl"/>
205 <!--exec dir="${basedir}/build/html" executable="xsltproc" failonerror="true">
206 <arg value="- -nonet"/>
207 <arg value="../../stylesheets/zh/html.xsl"/>
208 <arg value="../defguide-zh.xml"/>
210 <touch file="build/html/.done"/>
213 <target name="pdf.init">
214 <uptodate property="pdf.isUpToDate" targetfile="build/defguide-zh.pdf">
215 <srcfiles dir="source" includes="defguide.xml"/>
216 <srcfiles dir="po" includes="zh.po"/>
217 <srcfiles dir="stylesheets" includes="fo.xsl"/>
218 <srcfiles dir="stylesheets/zh" includes="fo.xsl"/>
222 <!-- Total time: 10 minutes 44 seconds -->
223 <target name="pdf" depends="init,translate,pdf.init" unless="pdf.isUpToDate"
224 description="Generate document - pdf">
225 <copy todir="build/schema">
226 <fileset dir="source/schema"/>
228 <copy todir="build/images">
229 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
231 <copy todir="build/figures">
232 <fileset dir="source/figures" />
234 <copy todir="build/examples">
235 <fileset dir="../en/examples"/>
238 <echo message="Making fo ..."/>
239 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
240 failonerror="true" dir="${basedir}/build">
241 <jvmarg value="-Xss512k"/>
242 <classpath refid="lib.classpath"/>
244 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
246 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
248 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
250 <arg value="defguide-zh.fo"/>
251 <arg value="defguide-zh.xml"/>
252 <arg value="../stylesheets/zh/fo.xsl"/>
253 <arg value="fop1.extensions=1"/>
254 <arg value="title.font.family=${fop.title.font.family}"/>
255 <arg value="body.font.family=${fop.body.font.family}"/>
256 <arg value="sans.font.family=${fop.sans.font.family}"/>
257 <arg value="ingbat.font.family=${fop.ingbat.font.family}"/>
258 <arg value="monospace.font.family=${fop.monospace.font.family}"/>
261 <echo message="Making pdf ..."/>
262 <java classname="${fop.class}" fork="true" maxmemory="1024m"
263 failonerror="true" dir="${basedir}/build">
264 <classpath refid="lib.classpath"/>
266 <arg value="${fop.home}/conf/userconfig.xml"/>
267 <arg value="defguide-zh.fo"/>
268 <arg value="defguide-zh.pdf"/>
272 <!-- Total time: 12 minutes 49 seconds -->
273 <target name="pdf-xep" depends="init,translate,pdf.init" unless="pdf.isUpToDate"
274 description="Generate document - pdf - xep">
275 <copy todir="build/schema">
276 <fileset dir="source/schema"/>
278 <copy todir="build/images">
279 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
281 <copy todir="build/figures">
282 <fileset dir="source/figures" />
284 <copy todir="build/examples">
285 <fileset dir="../en/examples"/>
288 <echo message="Making fo ..."/>
289 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
290 failonerror="true" dir="${basedir}/build">
291 <jvmarg value="-Xss1m"/>
292 <classpath refid="lib.classpath"/>
294 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
296 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
298 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
300 <arg value="defguide-zh.fo"/>
301 <arg value="defguide-zh.xml"/>
302 <arg value="../stylesheets/zh/fo.xsl"/>
303 <arg value="xep.extensions=1"/>
306 <echo message="Making pdf ..."/>
307 <java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m"
308 failonerror="true" dir="${basedir}/build">
309 <jvmarg value="-Xss512k"/>
310 <classpath refid="xep.classpath"/>
311 <arg value="-DCONFIG=${xep.home}/xep.xml"/>
312 <arg value="-quiet"/>
313 <arg value="defguide-zh.fo"/>
314 <arg value="defguide-zh.pdf"/>
318 <target name="defguide.init">
319 <uptodate property="defguide.isUpToDate" targetfile="build/defguide.pdf">
320 <srcfiles dir="source" includes="defguide.xml"/>
324 <!-- Total time: 12 minutes 14 seconds -->
325 <target name="defguide" depends="init,defguide.init" unless="defguide.isUpToDate"
326 description="Generate document - defguide(en)">
327 <copy todir="build/schema">
328 <fileset dir="source/schema"/>
330 <copy todir="build/images">
331 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
333 <copy todir="build/figures">
334 <fileset dir="source/figures" />
336 <copy todir="build/examples">
337 <fileset dir="../en/examples"/>
339 <copy file="source/defguide.xml" todir="build"/>
341 <echo message="Making fo ..."/>
342 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
343 failonerror="true" dir="${basedir}/build">
344 <jvmarg value="-Xss512k"/>
345 <classpath refid="lib.classpath"/>
347 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
349 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
351 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
353 <arg value="defguide.fo"/>
354 <arg value="defguide.xml"/>
355 <arg value="../stylesheets/fo.xsl"/>
356 <arg value="fop1.extensions=1"/>
357 <arg value="title.font.family=${fop.title.font.family}"/>
358 <arg value="body.font.family=${fop.body.font.family}"/>
359 <arg value="sans.font.family=${fop.sans.font.family}"/>
360 <arg value="ingbat.font.family=${fop.ingbat.font.family}"/>
361 <arg value="monospace.font.family=${fop.monospace.font.family}"/>
364 <echo message="Making pdf ..."/>
365 <java classname="${fop.class}" fork="true" maxmemory="1024m"
366 failonerror="true" dir="${basedir}/build">
367 <classpath refid="lib.classpath"/>
369 <arg value="${fop.home}/conf/userconfig.xml"/>
370 <arg value="defguide.fo"/>
371 <arg value="defguide.pdf"/>
375 <!-- Total time: 14 minutes 57 seconds -->
376 <target name="defguide-xep" depends="init,defguide.init" unless="defguide.isUpToDate"
377 description="Generate document - defguide(en) - xep">
378 <copy todir="build/schema">
379 <fileset dir="source/schema"/>
381 <copy todir="build/images">
382 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
384 <copy todir="build/figures">
385 <fileset dir="source/figures" />
387 <copy todir="build/examples">
388 <fileset dir="../en/examples"/>
390 <copy file="source/defguide.xml" todir="build"/>
392 <echo message="Making fo ..."/>
393 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
394 failonerror="true" dir="${basedir}/build">
395 <jvmarg value="-Xss1m"/>
396 <classpath refid="lib.classpath"/>
398 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
400 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
402 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
404 <arg value="defguide.fo"/>
405 <arg value="defguide.xml"/>
406 <arg value="../stylesheets/fo.xsl"/>
407 <arg value="xep.extensions=1"/>
410 <echo message="Making pdf ..."/>
411 <java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m"
412 failonerror="true" dir="${basedir}/build">
413 <jvmarg value="-Xss512k"/>
414 <classpath refid="xep.classpath"/>
415 <arg value="-DCONFIG=${xep.home}/xep.xml"/>
416 <arg value="-quiet"/>
417 <arg value="defguide.fo"/>
418 <arg value="defguide.pdf"/>
422 <target name="defguide-html.init">
423 <uptodate property="defguide-html.isUpToDate" targetfile="build/defguide/.done">
424 <srcfiles dir="source" includes="defguide.xml"/>
425 <srcfiles dir="stylesheets" includes="html.xsl"/>
429 <!-- Total time: ?? minutes ?? seconds -->
430 <target name="defguide-html" depends="init,defguide-html.init" unless="defguide-html.isUpToDate"
431 description="Generate document - defguide(en) - html">
432 <copy todir="build/schema">
433 <fileset dir="source/schema"/>
435 <copy todir="build/defguide/images">
436 <fileset dir="${docbook.xsl}/images" includes="**/*.png"/>
438 <copy todir="build/defguide/figures">
439 <fileset dir="source/figures" />
441 <copy todir="build/examples">
442 <fileset dir="../en/examples"/>
444 <copy file="source/defguide.xml" todir="build"/>
446 <echo message="Making html ..."/>
447 <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
448 failonerror="true" dir="${basedir}/build/defguide">
449 <jvmarg value="-Xss512k"/>
450 <classpath refid="lib.classpath"/>
452 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
454 <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
456 <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
457 <arg value="../../source/defguide.xml"/>
458 <arg value="../../stylesheets/html.xsl"/>
460 <touch file="build/defguide/.done"/>