1
<project name="DocSupport" default="all.doc" basedir=".">
3
<!--name of pdf output file-->
4
<property name="pdf.name" value="Multiplex.pdf"/>
6
<dirname property="build.basedir" file="${ant.file.DocSupport}"/>
7
<property name="support.basedir" value="${build.basedir}/../guide/support"/>
9
<!-- Set build directories for all formats. -->
10
<property name="build.dir" value="${basedir}/build"/>
12
<!-- Support files for build process. -->
13
<property name="support.dir" value="${support.basedir}/support"/>
14
<property name="styles.dir" value="${support.basedir}/styles"/>
16
<!-- Set DocBook stylesheets. -->
17
<property name="db.style.fopdf" value="fopdf.xsl"/>
18
<property name="db.style.html" value="html_chunk.xsl"/>
19
<property name="db.style.htmlsingle" value="html.xsl"/>
21
<property name="maxmem" value="1024m"/>
23
<xmlcatalog id="docbook.catalog">
24
<catalogpath path="${support.basedir}/docbook-dtd/catalog.xml"/>
28
<!-- Classpath for the build tools. -->
29
<path id="lib.classpath">
30
<fileset dir="${support.dir}/lib">
31
<include name="**/*.jar"/>
35
<!-- ################################################################## -->
37
<target name="all.doc" depends="clean">
38
<antcall target="lang.all">
39
<param name="lang" value="en"/>
43
<!-- ################################################################## -->
45
<target name="lang.all.bypass.check" unless="lang.all.bypass.disabled">
46
<uptodate property="lang.all.bypass.on" targetfile="${build.dir}/${lang}/pdf/${pdf.name}">
47
<srcfiles dir="${support.basedir}" includes="**"/>
48
<srcfiles dir="${basedir}/${lang}" includes="**"/>
49
<srcfiles dir="${basedir}" includes="build.xml"/>
53
<target name="lang.all.run" depends="lang.all.bypass.check, lang.all.bypass.message" unless="lang.all.bypass.on">
54
<antcall target="clean"/>
55
<antcall target="lang.all"/>
58
<target name="lang.all.bypass.message" if="lang.all.bypass.on">
59
<echo>Already uptodate: ${build.dir}/${lang}/pdf/${pdf.name}</echo>
60
<echo>add -Dlang.all.bypass.disabled=true to force a rebuild</echo>
63
<!-- ################################################################## -->
65
<target name="lang.dochtml.bypass.check" unless="lang.dochtml.bypass.disabled">
66
<uptodate property="lang.dochtml.bypass.on" targetfile="${build.dir}/${lang}/html/index.html">
67
<srcfiles dir="${support.basedir}" includes="**"/>
68
<srcfiles dir="${basedir}/${lang}" includes="**"/>
69
<srcfiles dir="${basedir}" includes="build.xml"/>
73
<target name="lang.dochtml.run" depends="lang.dochtml.bypass.check, lang.dochtml.bypass.message"
74
unless="lang.dochtml.bypass.on">
75
<antcall target="clean.dochtml"/>
76
<antcall target="lang.dochtml"/>
77
<antcall target="lang.dochtmlsingle"/>
80
<target name="lang.dochtml.bypass.message" if="lang.dochtml.bypass.on">
81
<echo>Already uptodate: ${build.dir}/${lang}/html/index.html</echo>
82
<echo>add -Dlang.dochtml.bypass.disabled=true to force a rebuild</echo>
85
<!-- ################################################################## -->
88
<!-- Delete build directory. -->
89
<delete dir="${build.dir}"/>
92
<target name="clean.dochtml">
93
<!-- Delete build directory for single html -->
94
<delete dir="${build.dir}/${lang}/html"/>
95
<delete dir="${build.dir}/${lang}/html_single"/>
98
<!-- ################################################################## -->
100
<target name="lang.all">
101
<antcall target="lang.docpdf"/>
102
<antcall target="lang.dochtml"/>
103
<antcall target="lang.dochtmlsingle"/>
105
<antcall target="lang.htmlmisc"/>
109
<target name="lang.docpdf">
110
<!-- Copy all the images to the output location,
111
will be removed later. -->
112
<copy todir="${build.dir}/${lang}/pdf/images">
113
<fileset dir="${basedir}/${lang}/images">
114
<include name="**/*.png"/>
115
<include name="**/*.svg"/>
116
<include name="**/*.gif"/>
117
<include name="**/*.jpg"/>
121
<!-- Create the XSL/FO temporary file. -->
123
<java classname="com.icl.saxon.StyleSheet"
124
maxmemory="${maxmem}"
125
fork="true" dir="${basedir}">
126
<classpath refid="lib.classpath"/>
128
<arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
129
<arg value="${basedir}/${lang}/multiplex.xml"/>
130
<arg value="${styles.dir}/${lang}/${db.style.fopdf}"/>
135
<xslt out="${build.dir}/${lang}/pdf/docbook_fop.tmp"
136
in="${basedir}/${lang}/master.xml"
137
style="${styles.dir}/${lang}/${db.style.fopdf}">
138
<xmlcatalog refid="docbook.catalog"/>
141
<!-- Create a PDF from the XSL/FO. -->
142
<java classname="org.apache.fop.apps.Fop"
143
maxmemory="${maxmem}"
144
fork="true" dir="${basedir}">
145
<classpath refid="lib.classpath"/>
146
<arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
147
<arg value="${build.dir}/${lang}/pdf/${pdf.name}"/>
150
<!-- Delete temporary files. -->
151
<delete file="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
152
<delete dir="${build.dir}/${lang}/pdf/images"/>
155
<target name="lang.dochtml">
156
<mkdir dir="${build.dir}/${lang}/html/"/>
158
<!-- Copy all the images to the output location -->
159
<copy todir="${build.dir}/${lang}/html/images">
160
<fileset dir="${basedir}/${lang}/images">
161
<include name="**/*.png"/>
162
<include name="**/*.gif"/>
163
<include name="**/*.jpg"/>
166
<copy todir="${build.dir}/${lang}/html/css">
167
<fileset dir="${styles.dir}/${lang}">
168
<include name="**/*.css"/>
172
<java classname="com.icl.saxon.StyleSheet"
173
fork="true" dir="${build.dir}/${lang}/html">
174
<classpath refid="lib.classpath"/>
175
<arg value="${basedir}/${lang}/multiplex.xml"/>
176
<arg value="${styles.dir}/${lang}/${db.style.html}"/>
180
<target name="lang.dochtmlsingle">
181
<mkdir dir="${build.dir}/${lang}/html_single/"/>
183
<!-- Copy all the images to the output location -->
184
<copy todir="${build.dir}/${lang}/html_single/images">
185
<fileset dir="${basedir}/${lang}/images">
186
<include name="**/*.png"/>
187
<include name="**/*.gif"/>
188
<include name="**/*.jpg"/>
191
<copy todir="${build.dir}/${lang}/html_single/css">
192
<fileset dir="${styles.dir}/${lang}">
193
<include name="**/*.css"/>
197
<java classname="com.icl.saxon.StyleSheet"
198
fork="true" dir="${basedir}">
199
<classpath refid="lib.classpath"/>
201
<arg value="${build.dir}/${lang}/html_single/index.html"/>
202
<arg value="${basedir}/${lang}/multiplex.xml"/>
203
<arg value="${styles.dir}/${lang}/${db.style.htmlsingle}"/>
207
<!-- I do not really like to have external dependency for HTML pages
208
So, I am not using this task ... -->
209
<target name="lang.htmlmisc">
210
<!-- Copy images and CSS for HTML documentation, language specific. -->
211
<copy todir="${build.dir}/${lang}/shared/images">
212
<fileset dir="${basedir}/${lang}/images">
213
<include name="**/*.png"/>
214
<include name="**/*.gif"/>
218
<copy todir="${build.dir}/${lang}/shared/css">
219
<fileset dir="${styles.dir}/${lang}">
220
<include name="**/*.css"/>