1
<project name="DocSupport" default="all.doc" basedir=".">
3
<dirname property="support.basedir" file="${ant.file.DocSupport}"/>
5
<!-- Set build directories for all formats. -->
6
<property name="build.dir" value="${basedir}/build"/>
8
<!-- Support files for build process. -->
9
<property name="support.dir" value="${support.basedir}/support"/>
10
<property name="styles.dir" value="${support.basedir}/styles"/>
12
<!-- Set DocBook stylesheets. -->
13
<property name="db.style.fopdf" value="fopdf.xsl"/>
14
<property name="db.style.html" value="html_chunk.xsl"/>
15
<property name="db.style.htmlsingle" value="html.xsl"/>
17
<property name="maxmem" value="1024m"/>
19
<xmlcatalog id="docbook.catalog">
20
<catalogpath path="${support.basedir}/docbook-dtd/catalog.xml"/>
24
<!-- Classpath for the build tools. -->
25
<path id="lib.classpath">
26
<fileset dir="${support.dir}/lib">
27
<include name="**/*.jar"/>
31
<!-- ################################################################## -->
33
<target name="all.doc" depends="clean">
34
<antcall target="lang.all">
35
<param name="lang" value="en"/>
39
<!-- ################################################################## -->
41
<target name="lang.all.bypass.check" unless="lang.all.bypass.disabled">
42
<uptodate property="lang.all.bypass.on" targetfile="${build.dir}/${lang}/pdf/${pdf.name}">
43
<srcfiles dir="${support.basedir}" includes="**"/>
44
<srcfiles dir="${basedir}/${lang}" includes="**"/>
45
<srcfiles dir="${basedir}" includes="build.xml"/>
49
<target name="lang.all.run" depends="lang.all.bypass.check, lang.all.bypass.message" unless="lang.all.bypass.on">
50
<antcall target="clean"/>
51
<antcall target="lang.all"/>
54
<target name="lang.all.bypass.message" if="lang.all.bypass.on">
55
<echo>Already uptodate: ${build.dir}/${lang}/pdf/${pdf.name}</echo>
56
<echo>add -Dlang.all.bypass.disabled=true to force a rebuild</echo>
59
<!-- ################################################################## -->
61
<target name="lang.dochtml.bypass.check" unless="lang.dochtml.bypass.disabled">
62
<uptodate property="lang.dochtml.bypass.on" targetfile="${build.dir}/${lang}/html/index.html">
63
<srcfiles dir="${support.basedir}" includes="**"/>
64
<srcfiles dir="${basedir}/${lang}" includes="**"/>
65
<srcfiles dir="${basedir}" includes="build.xml"/>
69
<target name="lang.dochtml.run" depends="lang.dochtml.bypass.check, lang.dochtml.bypass.message"
70
unless="lang.dochtml.bypass.on">
71
<antcall target="clean.dochtml"/>
72
<antcall target="lang.dochtml"/>
73
<antcall target="lang.dochtmlsingle"/>
76
<target name="lang.dochtml.bypass.message" if="lang.dochtml.bypass.on">
77
<echo>Already uptodate: ${build.dir}/${lang}/html/index.html</echo>
78
<echo>add -Dlang.dochtml.bypass.disabled=true to force a rebuild</echo>
81
<!-- ################################################################## -->
84
<!-- Delete build directory. -->
85
<delete dir="${build.dir}"/>
88
<target name="clean.dochtml">
89
<!-- Delete build directory for single html -->
90
<delete dir="${build.dir}/${lang}/html"/>
91
<delete dir="${build.dir}/${lang}/html_single"/>
94
<!-- ################################################################## -->
96
<target name="lang.all">
97
<antcall target="lang.docpdf"/>
98
<antcall target="lang.dochtml"/>
99
<antcall target="lang.dochtmlsingle"/>
101
<antcall target="lang.htmlmisc"/>
105
<target name="lang.docpdf">
106
<!-- Copy all the images to the output location,
107
will be removed later. -->
108
<copy todir="${build.dir}/${lang}/pdf/images">
109
<fileset dir="${basedir}/${lang}/images">
110
<include name="**/*.png"/>
111
<include name="**/*.svg"/>
112
<include name="**/*.gif"/>
113
<include name="**/*.jpg"/>
117
<!-- Create the XSL/FO temporary file. -->
119
<java classname="com.icl.saxon.StyleSheet"
120
maxmemory="${maxmem}"
121
fork="true" dir="${basedir}">
122
<classpath refid="lib.classpath"/>
124
<arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
125
<arg value="${basedir}/${lang}/master.xml"/>
126
<arg value="${styles.dir}/${lang}/${db.style.fopdf}"/>
131
<xslt out="${build.dir}/${lang}/pdf/docbook_fop.tmp"
132
in="${basedir}/${lang}/master.xml"
133
style="${styles.dir}/${lang}/${db.style.fopdf}">
134
<xmlcatalog refid="docbook.catalog"/>
137
<!-- Create a PDF from the XSL/FO. -->
138
<java classname="org.apache.fop.apps.Fop"
139
maxmemory="${maxmem}"
140
fork="true" dir="${basedir}">
141
<classpath refid="lib.classpath"/>
142
<arg value="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
143
<arg value="${build.dir}/${lang}/pdf/${pdf.name}"/>
146
<!-- Delete temporary files. -->
147
<delete file="${build.dir}/${lang}/pdf/docbook_fop.tmp"/>
148
<delete dir="${build.dir}/${lang}/pdf/images"/>
151
<target name="lang.dochtml">
152
<mkdir dir="${build.dir}/${lang}/html/"/>
154
<!-- Copy all the images to the output location -->
155
<copy todir="${build.dir}/${lang}/html/images">
156
<fileset dir="${basedir}/${lang}/images">
157
<include name="**/*.png"/>
158
<include name="**/*.gif"/>
159
<include name="**/*.jpg"/>
162
<copy todir="${build.dir}/${lang}/html/css">
163
<fileset dir="${styles.dir}/${lang}">
164
<include name="**/*.css"/>
168
<java classname="com.icl.saxon.StyleSheet"
169
fork="true" dir="${build.dir}/${lang}/html">
170
<classpath refid="lib.classpath"/>
171
<arg value="${basedir}/${lang}/master.xml"/>
172
<arg value="${styles.dir}/${lang}/${db.style.html}"/>
176
<target name="lang.dochtmlsingle">
177
<mkdir dir="${build.dir}/${lang}/html_single/"/>
179
<!-- Copy all the images to the output location -->
180
<copy todir="${build.dir}/${lang}/html_single/images">
181
<fileset dir="${basedir}/${lang}/images">
182
<include name="**/*.png"/>
183
<include name="**/*.gif"/>
184
<include name="**/*.jpg"/>
187
<copy todir="${build.dir}/${lang}/html_single/css">
188
<fileset dir="${styles.dir}/${lang}">
189
<include name="**/*.css"/>
193
<java classname="com.icl.saxon.StyleSheet"
194
fork="true" dir="${basedir}">
195
<classpath refid="lib.classpath"/>
197
<arg value="${build.dir}/${lang}/html_single/index.html"/>
198
<arg value="${basedir}/${lang}/master.xml"/>
199
<arg value="${styles.dir}/${lang}/${db.style.htmlsingle}"/>
203
<!-- I do not really like to have external dependency for HTML pages
204
So, I am not using this task ... -->
205
<target name="lang.htmlmisc">
206
<!-- Copy images and CSS for HTML documentation, language specific. -->
207
<copy todir="${build.dir}/${lang}/shared/images">
208
<fileset dir="${basedir}/${lang}/images">
209
<include name="**/*.png"/>
210
<include name="**/*.gif"/>
214
<copy todir="${build.dir}/${lang}/shared/css">
215
<fileset dir="${styles.dir}/${lang}">
216
<include name="**/*.css"/>