Remove jvmarg '-XX:-UseGCOverheadLimit'.
[docbook-zh.git] / defguide5 / en / build.xml
blobd99aac8ef39c223a7c75f2e4b1fe7f3dfc3320bb
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3 Usage:
4     Building 'The Definitive Guide (5.0)' - all(html, chm & pdf)
5         $ ant
7     Building 'The Definitive Guide (5.0)' - html
8         $ ant html
10     Building 'The Definitive Guide (5.0)' - chm
11         $ ant chm
13     Building 'The Definitive Guide (5.0)' - pdf
14         $ ant pdf
15 -->
16 <project name="defguide5-en" default="all">
18     <property file="../build-common.properties"/>
19     <import file="../build-common.xml"/>
21     <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"/>
23     <target name="usage">
24         <echo message="Use the -projecthelp option instead"/>
25     </target>
27     <target name="clean" description="Clean the build directory">
28         <delete dir="build"/>
29         <delete file="bookinfo.xml"/>
30         <ant dir="refpages" target="clean"/>
31     </target>
33     <target name="init" description="Check runtime configuration">
34         <echo message="java.version: ${java.version}"/>
36         <fail>
37             <condition>
38                 <not><available file="../build-common.properties"/></not>
39             </condition>
40             Please create your ../build-common.properties from ../build-common.properties.tmpl !
41         </fail>
43         <antcall target="init-avail"/>
44     </target>
46     <target name="validate" depends="xinclude" description="Validate document">
47         <jing rngfile="${docbook5.home}/rng/docbook.rng" checkid="false">
48             <fileset dir="src" includes="**/*.xml"/>
49         </jing>
50         <!--ant dir="refpages" target="validate"/-->
51         <jing rngfile="${docbook5.home}/rng/docbook.rng"
52                 file="../en/build/defguide5.xml"/>
53     </target>
55     <target name="all" description="Generate document - pdf,html,chm">
56         <antcall target="pdf"/>
57         <antcall target="html"/>
58         <antcall target="chm"/>
59     </target>
61     <target name="xinclude.init">
62         <uptodate property="xinclude.isUpToDate" targetfile="build/defguide5.xml">
63             <srcfiles dir="." includes="book.xml, VERSION.xml"/>
64             <srcfiles dir="src" includes="*.xml"/>
65             <srcfiles dir="refpages" includes="intro-elements.xml, references.xml, elements/**/*.xml"/>
66         </uptodate>
67     </target>
69     <target name="xinclude" depends="init, xinclude.init" unless="xinclude.isUpToDate" description="XInclude processing on document">
70         <ant dir="refpages" target="all"/>
72         <copy todir="build/graphics">
73             <fileset dir="graphics" includes="*.eps,*.gif,*.png,*.svg"/>
74         </copy>
75         <copy todir="build/figures">
76             <fileset dir="figures" includes="*.eps,*.gif,*.png,*.svg"/>
77         </copy>
79         <exec dir="${basedir}" executable="xsltproc" failonerror="true">
80             <arg value="--nonet"/>
81             <arg value="--output"/>
82             <arg value="bookinfo.xml"/>
83             <arg value="VERSION.xml"/>
84             <arg value="VERSION.xml"/>
85         </exec>
87         <exec dir="${basedir}" executable="xmllint">
88             <arg value="--nonet"/>
89             <arg value="--xinclude"/>
90             <arg value="--output"/>
91             <arg value="build/defguide5.xml"/>
92             <arg value="book.xml"/>
93         </exec>
94     </target>
96     <target name="html.init">
97         <uptodate property="html.isUpToDate" targetfile="build/defguide5/.done">
98             <srcfiles dir="." includes="book.xml, VERSION.xml"/>
99             <srcfiles dir="src" includes="*.xml"/>
100             <srcfiles dir="refpages" includes="intro-elements.xml, references.xml, elements/**/*.xml"/>
101             <srcfiles dir="stylesheets" includes="html.xsl"/>
102         </uptodate>
103     </target>
105     <!-- Total time: 9 minutes 10 seconds -->
106     <target name="html" depends="xinclude,html.init" unless="html.isUpToDate" description="Generate document - html">
107         <copy file="html/defguide.css" todir="build/defguide5"/>
109         <copy todir="build/defguide5/src/examples">
110           <fileset dir="examples"/>
111         </copy>
112         <copy todir="build/defguide5/images">
113             <fileset dir="${docbook.xsl}/images" includes="**/*.png,**/*.svg"/>
114         </copy>
115         <copy todir="build/defguide5/graphics">
116             <fileset dir="graphics" includes="*.eps,*.gif,*.png,*.svg"/>
117         </copy>
118         <copy todir="build/defguide5/figures">
119             <fileset dir="figures" includes="*.eps,*.gif,*.png,*.svg"/>
120         </copy>
122         <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m" failonerror="true" dir="build/defguide5">
123             <jvmarg value="-Xss512k"/>
124             <classpath refid="lib.classpath"/>
125             <arg value="-x"/>
126             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
127             <arg value="-y"/>
128             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
129             <arg value="-r"/>
130             <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
131             <arg value="../defguide5.xml"/>
132             <arg value="../../stylesheets/html.xsl"/>
133         </java>
134         <!--exec dir="build/defguide5" executable="xsltproc" failonerror="true">
135             <arg value="- -nonet"/>
136             <arg value="stylesheets/html.xsl"/>
137             <arg value="build/defguide5.xml"/>
138         </exec-->
140         <touch file="build/defguide5/.done"/>
141     </target>
143     <target name="chm.init">
144         <uptodate property="chm.isUpToDate" targetfile="build/defguide5.chm">
145             <srcfiles dir="." includes="book.xml, VERSION.xml"/>
146             <srcfiles dir="src" includes="*.xml"/>
147             <srcfiles dir="refpages" includes="intro-elements.xml, references.xml, elements/**/*.xml"/>
148             <srcfiles dir="stylesheets" includes="htmlhelp.xsl"/>
149         </uptodate>
150     </target>
152     <target name="chm" depends="xinclude,chm.init" unless="chm.isUpToDate" description="Generate document - chm">
153         <fail>
154             <condition>
155                 <not><os family="windows"/></not>
156             </condition>
157             This target only work on windows !
158         </fail>
160         <copy file="html/defguide.css" todir="build/chm/htmlhelp"/>
162         <copy todir="build/src/examples">
163           <fileset dir="examples"/>
164         </copy>
165         <copy todir="build/chm/htmlhelp/images">
166             <fileset dir="${docbook.xsl}/images" includes="**/*.png,**/*.svg"/>
167         </copy>
168         <copy todir="build/chm/htmlhelp/graphics">
169             <fileset dir="graphics" includes="*.eps,*.gif,*.png,*.svg"/>
170         </copy>
171         <copy todir="build/chm/htmlhelp/figures">
172             <fileset dir="figures" includes="*.eps,*.gif,*.png,*.svg"/>
173         </copy>
175         <exec dir="build/chm" executable="xsltproc" failonerror="true">
176             <arg value="--nonet"/>
177             <arg value="stylesheets/chm.xsl"/>
178             <arg value="build/defguide5.xml"/>
179         </exec>
180         <exec dir="build/chm" executable="hhc" failonerror="false">
181             <arg value="htmlhelp.hhp"/>
182         </exec>
184         <move file="build/chm/defguide5.chm" tofile="build/defguide5.chm"/>
185     </target>
187     <target name="pdf.init">
188         <uptodate property="pdf.isUpToDate" targetfile="build/defguide5.pdf">
189             <srcfiles dir="." includes="book.xml, VERSION.xml"/>
190             <srcfiles dir="src" includes="*.xml"/>
191             <srcfiles dir="refpages" includes="intro-elements.xml, references.xml, elements/**/*.xml"/>
192             <srcfiles dir="stylesheets" includes="fo.xsl"/>
193         </uptodate>
194     </target>
196     <target name="pdf" depends="xinclude,pdf.init" unless="pdf.isUpToDate" description="Generate document - pdf">
197         <copy todir="build/src/examples">
198           <fileset dir="examples"/>
199         </copy>
200         <copy todir="build/pdf/images">
201             <fileset dir="${docbook.xsl}/images" includes="**/*.png,**/*.svg"/>
202         </copy>
203         <copy todir="build/refpages/graphics">
204             <fileset dir="graphics" includes="*.eps,*.gif,*.png,*.svg"/>
205         </copy>
206         <copy todir="build/refpages/elements/build/figures">
207             <fileset dir="figures" includes="*.eps,*.gif,*.png,*.svg"/>
208         </copy>
210         <echo message="Making fo ..."/>
211         <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
212                  failonerror="true" dir="build/pdf">
213             <jvmarg value="-Xss512k"/>
214             <classpath refid="lib.classpath"/>
215             <arg value="-x"/>
216             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
217             <arg value="-y"/>
218             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
219             <arg value="-r"/>
220             <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
221             <arg value="-o"/>
222             <arg value="defguide5.fo"/>
223             <arg value="../defguide5.xml"/>
224             <arg value="../../stylesheets/fo.xsl"/>
225             <arg value="fop1.extensions=1"/>
226             <arg value="title.font.family=${fop.title.font.family}"/>
227             <arg value="body.font.family=${fop.body.font.family}"/>
228             <arg value="sans.font.family=${fop.sans.font.family}"/>
229             <arg value="ingbat.font.family=${fop.ingbat.font.family}"/>
230             <arg value="monospace.font.family=${fop.monospace.font.family}"/>
231         </java>
233         <echo message="Making pdf ..."/>
234         <java classname="${fop.class}" fork="true" maxmemory="1024m" failonerror="true"
235                 dir="build/pdf">
236             <jvmarg value="-Djava.awt.headless=true"/>
237             <classpath refid="lib.classpath"/>
238             <arg value="-c"/>
239             <arg value="${fop.home}/conf/userconfig.xml"/>
240             <arg value="defguide5.fo"/>
241             <arg value="../defguide5.pdf"/>
242         </java>
243     </target>
245     <target name="pdf-xep" depends="xinclude,pdf.init" unless="pdf.isUpToDate" description="Generate document - pdf - xep">
246         <copy todir="build/src/examples">
247           <fileset dir="examples"/>
248         </copy>
249         <copy todir="build/pdf/images">
250             <fileset dir="${docbook.xsl}/images" includes="**/*.png,**/*.svg"/>
251         </copy>
252         <copy todir="build/refpages/graphics">
253             <fileset dir="graphics" includes="*.eps,*.gif,*.png,*.svg"/>
254         </copy>
255         <copy todir="build/refpages/elements/build/figures">
256             <fileset dir="figures" includes="*.eps,*.gif,*.png,*.svg"/>
257         </copy>
259         <echo message="Making fo ..."/>
260         <java classname="com.icl.saxon.StyleSheet" fork="true" maxmemory="1024m"
261                  failonerror="true" dir="build/pdf">
262             <jvmarg value="-Xss512k"/>
263             <classpath refid="lib.classpath"/>
264             <arg value="-x"/>
265             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
266             <arg value="-y"/>
267             <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
268             <arg value="-r"/>
269             <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
270             <arg value="-o"/>
271             <arg value="defguide5.fo"/>
272             <arg value="../defguide5.xml"/>
273             <arg value="../../stylesheets/fo.xsl"/>
274             <arg value="xep.extensions=1"/>
275         </java>
277         <echo message="Making pdf ..."/>
278         <java classname="com.renderx.xep.XSLDriver" fork="true" maxmemory="1536m"
279                 failonerror="true" dir="build/pdf">
280             <jvmarg value="-Xss512k"/>
281             <classpath refid="xep.classpath"/>
282             <arg value="-DCONFIG=${xep.home}/xep.xml"/>
283             <arg value="-quiet"/>
284             <arg value="defguide5.fo"/>
285             <arg value="../defguide5.pdf"/>
286         </java>
288     </target>
290 </project>