1 | <?xml version="1.0" encoding="UTF-8" ?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!-- (c) Copyright IBM Corp. 2001, 2006 All Rights Reserved. -->
|
---|
6 | <project name="dita.build.demo" default="prompt" basedir=".">
|
---|
7 | <!-- Set a property for each environment variable -->
|
---|
8 | <description>Build the DITA Demos and Samples</description>
|
---|
9 | <property environment="env"/>
|
---|
10 |
|
---|
11 | <import file="${basedir}${file.separator}build.xml"/>
|
---|
12 |
|
---|
13 | <import file="${basedir}/samples/ant_sample/sample_all.xml"/>
|
---|
14 |
|
---|
15 | <target name="use.init">
|
---|
16 | <available classname="net.sf.saxon.StyleSheet"
|
---|
17 | property="hasSaxon"/>
|
---|
18 | <available classname="org.apache.fop.tools.anttasks.Fop"
|
---|
19 | property="hasFOP"/>
|
---|
20 | <available file="C:\Program Files\HTML Help Workshop\hhc.exe"
|
---|
21 | property="HTMLHelpCompiler"
|
---|
22 | value="C:\Program Files\HTML Help Workshop\hhc.exe"/>
|
---|
23 | <property name="clean.temp" value="true"/>
|
---|
24 | </target>
|
---|
25 |
|
---|
26 | <target name="all" description="build all output"
|
---|
27 | depends="samples">
|
---|
28 | <echo>Output from the demo build is in the directory
|
---|
29 | ${dita.output.dir}
|
---|
30 |
|
---|
31 | Previous releases also built a copy of the DITA 1.1 Language
|
---|
32 | specification. The toolkit now fully supports DITA 1.2, but
|
---|
33 | that specification is not included here due to its size.
|
---|
34 | Source material and published versions of the latest DITA 1.2
|
---|
35 | specification can be found here:
|
---|
36 | http://docs.oasis-open.org/dita/v1.2/spec/DITA1.2-spec.html</echo>
|
---|
37 | </target>
|
---|
38 | <!-- revise below here -->
|
---|
39 |
|
---|
40 | <!-- defaults for DITA configuration required by callable targets -->
|
---|
41 | <property name="dita.dir" value="${basedir}"/>
|
---|
42 | <property name="dita.dtd.dir"
|
---|
43 | value="${dita.dir}${file.separator}dtd"/>
|
---|
44 | <property name="dita.css.dir"
|
---|
45 | value="${dita.dir}${file.separator}css"/>
|
---|
46 | <property name="dita.resource.dir"
|
---|
47 | value="${dita.dir}${file.separator}resource"/>
|
---|
48 |
|
---|
49 | <!-- defaults for DITA output configuration -->
|
---|
50 | <property name="dita.doc.dir"
|
---|
51 | value="${dita.dir}${file.separator}doc"/>
|
---|
52 | <property name="dita.doc.langref.dir"
|
---|
53 | value="${dita.doc.dir}${file.separator}langref-dita1.1"/>
|
---|
54 | <property name="dita.doc.articles.dir"
|
---|
55 | value="${dita.doc.dir}${file.separator}articles"/>
|
---|
56 |
|
---|
57 | <property name="dita.samples.dir"
|
---|
58 | value="${dita.dir}${file.separator}samples"/>
|
---|
59 |
|
---|
60 | <property name="dita.output.dir"
|
---|
61 | value="${dita.dir}${file.separator}out"/>
|
---|
62 |
|
---|
63 | <property name="dita.output.docbook.dir"
|
---|
64 | value="${dita.output.dir}${file.separator}docbook"/>
|
---|
65 |
|
---|
66 |
|
---|
67 |
|
---|
68 | <target name="clean"
|
---|
69 | description="delete all output">
|
---|
70 | <delete dir="${dita.output.dir}"/>
|
---|
71 | </target>
|
---|
72 |
|
---|
73 | <!-- mid-level targets -->
|
---|
74 | <target name="init"
|
---|
75 | depends="use.init">
|
---|
76 | <!-- Create the time stamp -->
|
---|
77 | <tstamp/>
|
---|
78 | <mkdir dir="${dita.temp.dir}"/>
|
---|
79 | <mkdir dir="${dita.output.dir}"/>
|
---|
80 | </target>
|
---|
81 |
|
---|
82 | <target name="doc"
|
---|
83 | description="build the documentation"
|
---|
84 | depends="init, doc.articles.web, doc.readme.web, doc.installguide.chm">
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | <target name="init.doc.articles" depends="init">
|
---|
88 | <mkdir dir="${dita.output.doc.articles.dir}"/>
|
---|
89 | </target>
|
---|
90 |
|
---|
91 | <target name="doc.articles.web" depends="init.doc.articles"
|
---|
92 | description="Build the articles of dita as document.">
|
---|
93 | <antcall target="dita2xhtml">
|
---|
94 | <param name="args.input"
|
---|
95 | value="${dita.doc.articles.dir}${file.separator}DITA-articles.ditamap"/>
|
---|
96 | <param name="output.dir" value="${dita.output.doc.articles.dir}"/>
|
---|
97 | <param name="transtype" value="xhtml"/>
|
---|
98 | </antcall>
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <target name="doc.articles.chm" depends="init.doc.articles"
|
---|
102 | description="Build the articles of dita as document.">
|
---|
103 | <antcall target="dita2htmlhelp">
|
---|
104 | <param name="args.input"
|
---|
105 | value="${dita.doc.articles.dir}${file.separator}DITA-articles.ditamap"/>
|
---|
106 | <param name="output.dir" value="${dita.output.doc.articles.dir}"/>
|
---|
107 | <param name="transtype" value="htmlhelp"/>
|
---|
108 | </antcall>
|
---|
109 | </target>
|
---|
110 |
|
---|
111 | <target name="doc.articles.pdf" depends="init.doc.articles"
|
---|
112 | description="Build the articles of dita as document.">
|
---|
113 | <!-- DOST is the project name of imported build.xml-->
|
---|
114 | <antcall target="DOST.init">
|
---|
115 | <param name="args.input"
|
---|
116 | value="${dita.doc.articles.dir}${file.separator}DITA-articles.ditamap"/>
|
---|
117 | <param name="output.dir" value="${dita.output.doc.articles.dir}"/>
|
---|
118 | <param name="transtype" value="pdf"/>
|
---|
119 | </antcall>
|
---|
120 | </target>
|
---|
121 |
|
---|
122 | <target name="clean.doc.articles"
|
---|
123 | description="Delete the articles directory in doc.">
|
---|
124 | <delete dir="${dita.output.doc.articles.dir}"></delete>
|
---|
125 | </target>
|
---|
126 |
|
---|
127 | <target name="doc.readme.web" depends="init">
|
---|
128 | <antcall target="dita2xhtml">
|
---|
129 | <param name="args.input"
|
---|
130 | value="${dita.doc.dir}${file.separator}readme.ditamap"/>
|
---|
131 | <param name="output.dir" value="${dita.output.doc.dir}"/>
|
---|
132 | <param name="transtype" value="xhtml"/>
|
---|
133 | </antcall>
|
---|
134 | </target>
|
---|
135 |
|
---|
136 | <target name="doc.readme.chm" depends="init">
|
---|
137 | <antcall target="dita2htmlhelp">
|
---|
138 | <param name="args.input"
|
---|
139 | value="${dita.doc.dir}${file.separator}readme.ditamap"/>
|
---|
140 | <param name="output.dir" value="${dita.output.doc.dir}"/>
|
---|
141 | <param name="transtype" value="htmlhelp"/>
|
---|
142 | </antcall>
|
---|
143 | </target>
|
---|
144 |
|
---|
145 | <target name="doc.readme.pdf" depends="init">
|
---|
146 | <!-- DOST is the project name of imported build.xml-->
|
---|
147 | <antcall target="DOST.init">
|
---|
148 | <param name="args.input"
|
---|
149 | value="${dita.doc.dir}${file.separator}readme.ditamap"/>
|
---|
150 | <param name="output.dir" value="${dita.output.doc.dir}"/>
|
---|
151 | <param name="transtype" value="pdf"/>
|
---|
152 | </antcall>
|
---|
153 | </target>
|
---|
154 |
|
---|
155 | <target name="doc.installguide.web" depends="init">
|
---|
156 | <antcall target="dita2xhtml">
|
---|
157 | <param name="args.input"
|
---|
158 | value="${dita.doc.dir}${file.separator}ot-userguide${file.separator}DITAOT_UGRef_SOURCE${file.separator}installing${file.separator}installing_map.ditamap"/>
|
---|
159 | <param name="output.dir" value="${dita.output.doc.dir}${file.separator}installguide"/>
|
---|
160 | <param name="transtype" value="xhtml"/>
|
---|
161 | </antcall>
|
---|
162 | </target>
|
---|
163 |
|
---|
164 | <target name="doc.installguide.chm" depends="init">
|
---|
165 | <antcall target="dita2htmlhelp">
|
---|
166 | <param name="args.input"
|
---|
167 | value="${dita.doc.dir}${file.separator}ot-userguide${file.separator}DITAOT_UGRef_SOURCE${file.separator}installing${file.separator}installing_map.ditamap"/>
|
---|
168 | <param name="output.dir" value="${dita.output.doc.dir}${file.separator}installguide"/>
|
---|
169 | <param name="transtype" value="htmlhelp"/>
|
---|
170 | </antcall>
|
---|
171 | </target>
|
---|
172 |
|
---|
173 | <target name="doc.installguide.pdf" depends="init">
|
---|
174 | <!-- DOST is the project name of imported build.xml-->
|
---|
175 | <antcall target="DOST.init">
|
---|
176 | <param name="args.input"
|
---|
177 | value="${dita.doc.dir}${file.separator}ot-userguide${file.separator}DITAOT_UGRef_SOURCE${file.separator}installing${file.separator}installing_map.ditamap"/>
|
---|
178 | <param name="output.dir" value="${dita.output.doc.dir}${file.separator}installguide"/>
|
---|
179 | <param name="transtype" value="pdf"/>
|
---|
180 | </antcall>
|
---|
181 | </target>
|
---|
182 |
|
---|
183 | <target name="doc.quickstartguide.chm" depends="init">
|
---|
184 | <antcall target="dita2htmlhelp">
|
---|
185 | <param name="args.input"
|
---|
186 | value="${dita.doc.dir}${file.separator}quickstartguide.ditamap"/>
|
---|
187 | <param name="output.dir" value="${dita.output.doc.dir}"/>
|
---|
188 | <param name="transtype" value="htmlhelp"/>
|
---|
189 | </antcall>
|
---|
190 | </target>
|
---|
191 |
|
---|
192 | <target name="doc.quickstartguide.pdf" depends="init">
|
---|
193 | <!-- DOST is the project name of imported build.xml-->
|
---|
194 | <antcall target="DOST.init">
|
---|
195 | <param name="args.input"
|
---|
196 | value="${dita.doc.dir}${file.separator}quickstartguide.ditamap"/>
|
---|
197 | <param name="output.dir" value="${dita.output.doc.dir}"/>
|
---|
198 | <param name="transtype" value="pdf"/>
|
---|
199 | </antcall>
|
---|
200 | </target>
|
---|
201 |
|
---|
202 | <target name="clean.doc"
|
---|
203 | description="remove the documentation output">
|
---|
204 | <delete dir="${dita.output.doc.dir}"/>
|
---|
205 | </target>
|
---|
206 |
|
---|
207 | <target name="docbook"
|
---|
208 | description="transform the samples to DocBook"
|
---|
209 | depends="init">
|
---|
210 | <mkdir dir="${dita.output.docbook.dir}"/>
|
---|
211 |
|
---|
212 | <antcall target="samples.docbook"/>
|
---|
213 |
|
---|
214 | <antcall target="dita2docbook">
|
---|
215 | <param name="args.input"
|
---|
216 | value="${dita.doc.dir}${file.separator}readme${file.separator}DITA-readme.xml"/>
|
---|
217 | <param name="output.dir"
|
---|
218 | value="${dita.output.docbook.dir}"/>
|
---|
219 | <param name="transtype" value="docbook"/>
|
---|
220 | </antcall>
|
---|
221 | </target>
|
---|
222 |
|
---|
223 | <target name="clean.docbook"
|
---|
224 | description="remove the docbook output">
|
---|
225 | <delete dir="${dita.output.docbook.dir}"/>
|
---|
226 | </target>
|
---|
227 |
|
---|
228 | <!-- prompting target -->
|
---|
229 | <target name="prompt"
|
---|
230 | description="prompt to build anything"
|
---|
231 | depends="prompt.init">
|
---|
232 | <!-- The prompt strings should be externalized in a properties file
|
---|
233 | so they can be localized. -->
|
---|
234 | <echo>Please enter the filename for the DITA map that you
|
---|
235 | want to build including the directory path (if any).
|
---|
236 | The filename must have the .ditamap extension.
|
---|
237 | Note that relative paths that climb (..) are not supported yet.
|
---|
238 | To build the sample, press return without entering anything.</echo>
|
---|
239 | <input message="The DITA map filename: "
|
---|
240 | addproperty="prompt.ditamap.filename"
|
---|
241 | defaultvalue="${dita.samples.dir}${file.separator}hierarchy.ditamap"/>
|
---|
242 | <fail message="no map entered">
|
---|
243 | <condition>
|
---|
244 | <or>
|
---|
245 | <not><isset property="prompt.ditamap.filename"/></not>
|
---|
246 | <equals arg1="${prompt.ditamap.filename}" arg2=""/>
|
---|
247 | </or>
|
---|
248 | </condition>
|
---|
249 | </fail>
|
---|
250 | <fail message="cannot find ${prompt.ditamap.filename}">
|
---|
251 | <condition>
|
---|
252 | <not><available file="${prompt.ditamap.filename}"/></not>
|
---|
253 | </condition>
|
---|
254 | </fail>
|
---|
255 | <basename property="prompt.ditamap.fileroot"
|
---|
256 | file="${prompt.ditamap.filename}" suffix=".ditamap"/>
|
---|
257 | <dirname property="prompt.ditamap.directory"
|
---|
258 | file="${prompt.ditamap.filename}"/>
|
---|
259 | <echo>
|
---|
260 | Please enter the name of the output directory or press return
|
---|
261 | to accept the default.</echo>
|
---|
262 | <input message="The output directory (out): "
|
---|
263 | addproperty="prompt.output.directory"
|
---|
264 | defaultvalue="out"/>
|
---|
265 | <echo>
|
---|
266 | Please enter the type of output to generate.
|
---|
267 | Options include: eclipse, tocjs, htmlhelp, javahelp, pdf, or web
|
---|
268 | Use lowercase letters.
|
---|
269 | </echo>
|
---|
270 | <input message="The output type: "
|
---|
271 | addproperty="prompt.output.type"
|
---|
272 | validargs="eclipse,tocjs,htmlhelp,javahelp,pdf,web,docbook"
|
---|
273 | defaultvalue="web"/>
|
---|
274 | <condition property="isEclipseOutput">
|
---|
275 | <equals arg1="${prompt.output.type}" arg2="eclipse"/>
|
---|
276 | </condition>
|
---|
277 | <condition property="isTocjsOutput">
|
---|
278 | <equals arg1="${prompt.output.type}" arg2="tocjs"/>
|
---|
279 | </condition>
|
---|
280 | <condition property="isHtmlHelpOutput">
|
---|
281 | <equals arg1="${prompt.output.type}" arg2="htmlhelp"/>
|
---|
282 | </condition>
|
---|
283 | <condition property="isJavaHelpOutput">
|
---|
284 | <equals arg1="${prompt.output.type}" arg2="javahelp"/>
|
---|
285 | </condition>
|
---|
286 | <condition property="isPDFOutput">
|
---|
287 | <equals arg1="${prompt.output.type}" arg2="pdf"/>
|
---|
288 | </condition>
|
---|
289 | <condition property="isWebOutput">
|
---|
290 | <equals arg1="${prompt.output.type}" arg2="web"/>
|
---|
291 | </condition>
|
---|
292 | <condition property="isDocbookOutput">
|
---|
293 | <equals arg1="${prompt.output.type}" arg2="docbook"/>
|
---|
294 | </condition>
|
---|
295 | <echo>
|
---|
296 | Ready to build ${prompt.ditamap.filename}
|
---|
297 | for ${prompt.output.type} in ${prompt.output.directory}
|
---|
298 | </echo>
|
---|
299 | <input message="Continue? "
|
---|
300 | addproperty="prompt.output.confirm"
|
---|
301 | validargs="Y,y,N,n"
|
---|
302 | defaultvalue="y"/>
|
---|
303 | <fail message="not building">
|
---|
304 | <condition>
|
---|
305 | <or>
|
---|
306 | <equals arg1="${prompt.output.confirm}" arg2="N"/>
|
---|
307 | <equals arg1="${prompt.output.confirm}" arg2="n"/>
|
---|
308 | </or>
|
---|
309 | </condition>
|
---|
310 | </fail>
|
---|
311 | <antcall target="prompt.output"/>
|
---|
312 | <echo>
|
---|
313 | output in the ${prompt.output.directory} directory
|
---|
314 |
|
---|
315 | Before rebuilding, please delete the output or the directory.</echo>
|
---|
316 | </target>
|
---|
317 |
|
---|
318 | <target name="prompt.init">
|
---|
319 | <!-- Create the time stamp -->
|
---|
320 | <tstamp/>
|
---|
321 | </target>
|
---|
322 |
|
---|
323 | <target name="prompt.output.init" depends="init">
|
---|
324 | <mkdir dir="${prompt.output.directory}"/>
|
---|
325 | </target>
|
---|
326 |
|
---|
327 | <target name="prompt.output"
|
---|
328 | depends="prompt.output.eclipse, prompt.output.tocjs, prompt.output.javahelp, prompt.output.htmlhelp, prompt.output.pdf, prompt.output.web, prompt.output.docbook"/>
|
---|
329 |
|
---|
330 | <target name="prompt.output.web" depends="prompt.output.init"
|
---|
331 | if="isWebOutput">
|
---|
332 | <echoxml file="${prompt.output.directory}/index.html">
|
---|
333 | <html>
|
---|
334 | <head>
|
---|
335 | <title>Web Sample</title>
|
---|
336 | </head>
|
---|
337 | <frameset cols="40%,*">
|
---|
338 | <frame name="navwin" src="toc.html" />
|
---|
339 | <frame name="contentwin" src="about:blank" scrolling="auto" />
|
---|
340 | </frameset>
|
---|
341 | </html>
|
---|
342 | </echoxml>
|
---|
343 | <antcall target="dita2xhtml">
|
---|
344 | <param name="args.input" value="${prompt.ditamap.filename}"/>
|
---|
345 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
346 | <param name="args.xhtml.toc" value="toc"/>
|
---|
347 | <param name="dita.temp.dir" value="temp"/>
|
---|
348 | <param name="transtype" value="xhtml"/>
|
---|
349 | </antcall>
|
---|
350 | </target>
|
---|
351 |
|
---|
352 | <target name="prompt.output.eclipse" depends="prompt.output.init"
|
---|
353 | if="isEclipseOutput">
|
---|
354 | <antcall target="dita2eclipsehelp">
|
---|
355 | <param name="args.input" value="${prompt.ditamap.filename}"/>
|
---|
356 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
357 | <param name="args.eclipse.toc" value="toc"/>
|
---|
358 | <param name="dita.temp.dir" value="temp"/>
|
---|
359 | <param name="transtype" value="eclipsehelp"/>
|
---|
360 | </antcall>
|
---|
361 | </target>
|
---|
362 |
|
---|
363 | <target name="prompt.output.tocjs" depends="prompt.output.init"
|
---|
364 | if="isTocjsOutput">
|
---|
365 | <antcall target="dita2tocjs">
|
---|
366 | <param name="args.input" value="${prompt.ditamap.filename}"/>
|
---|
367 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
368 | <param name="dita.temp.dir" value="temp"/>
|
---|
369 | <param name="transtype" value="tocjs"/>
|
---|
370 | </antcall>
|
---|
371 | </target>
|
---|
372 |
|
---|
373 | <target name="prompt.output.javahelp" depends="prompt.output.init"
|
---|
374 | if="isJavaHelpOutput">
|
---|
375 | <antcall target="dita2javahelp">
|
---|
376 | <param name="args.input" value="${prompt.ditamap.filename}"/>
|
---|
377 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
378 | <param name="args.javahelp.toc" value="toc"/>
|
---|
379 | <param name="args.javahelp.map" value="map"/>
|
---|
380 | <param name="dita.temp.dir" value="temp"/>
|
---|
381 | <param name="transtype" value="javahelp"/>
|
---|
382 | </antcall>
|
---|
383 | </target>
|
---|
384 |
|
---|
385 | <target name="prompt.output.htmlhelp" depends="prompt.output.init"
|
---|
386 | if="isHtmlHelpOutput">
|
---|
387 | <antcall target="dita2htmlhelp">
|
---|
388 | <param name="args.input"
|
---|
389 | value="${prompt.ditamap.filename}"/>
|
---|
390 | <param name="output.dir"
|
---|
391 | value="${prompt.output.directory}"/>
|
---|
392 | <param name="dita.temp.dir" value="temp"/>
|
---|
393 | <param name="transtype" value="htmlhelp"/>
|
---|
394 | </antcall>
|
---|
395 | </target>
|
---|
396 |
|
---|
397 | <target name="prompt.output.pdf" depends="prompt.output.init"
|
---|
398 | if="isPDFOutput">
|
---|
399 | <!-- DOST is the project name of imported build.xml-->
|
---|
400 | <antcall target="DOST.init">
|
---|
401 | <param name="args.input"
|
---|
402 | value="${prompt.ditamap.filename}"/>
|
---|
403 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
404 | <param name="dita.temp.dir" value="temp"/>
|
---|
405 | <param name="transtype" value="pdf"/>
|
---|
406 | </antcall>
|
---|
407 | </target>
|
---|
408 |
|
---|
409 | <target name="prompt.output.docbook" depends="prompt.output.init"
|
---|
410 | if="isDocbookOutput">
|
---|
411 | <antcall target="dita2docbook">
|
---|
412 | <param name="args.input" value="${prompt.ditamap.filename}"/>
|
---|
413 | <param name="output.dir" value="${prompt.output.directory}"/>
|
---|
414 | <param name="dita.temp.dir" value="temp"/>
|
---|
415 | <param name="transtype" value="docbook"/>
|
---|
416 | </antcall>
|
---|
417 | </target>
|
---|
418 |
|
---|
419 | <!-- The whole process on which javamerge depends equals to the target "dita-process" in build.xml. -->
|
---|
420 | <target name="javamerge" description="Merge topics" depends="start-process, init-logger, check-arg, output-css-warn-message, preprocess">
|
---|
421 | <basename property="temp.base" file="${user.input.file}" suffix=".ditamap"/>
|
---|
422 | <property name="temp.input" value="${dita.temp.dir}${file.separator}${user.input.file}"/>
|
---|
423 | <property name="temp.output" value="${output.dir}${file.separator}${user.input.file}"/>
|
---|
424 | <dirname property="temp.dir" file="${temp.input}"/>
|
---|
425 | <dirname property="temp.outdir" file="${temp.output}"/>
|
---|
426 | <pipeline message="topicmerge" module="TopicMerge"
|
---|
427 | inputmap="${temp.dir}${file.separator}${temp.base}.ditamap"
|
---|
428 | tempdir="${dita.temp.dir}">
|
---|
429 | <param name="output" location="${temp.outdir}${file.separator}${temp.base}_merged.xml"/>
|
---|
430 | </pipeline>
|
---|
431 | </target>
|
---|
432 |
|
---|
433 | </project>
|
---|