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. 2012 All Rights Reserved. -->
|
---|
6 | <project name="build_DITA-OT_docs" default="all" basedir="..">
|
---|
7 | <description>Build User Guide for DITA Open Toolkit</description>
|
---|
8 |
|
---|
9 | <target name="init">
|
---|
10 | <condition property="HTMLHelpCompiler" value="C:\Program Files\HTML Help Workshop\hhc.exe">
|
---|
11 | <available file="C:\Program Files\HTML Help Workshop\hhc.exe"/>
|
---|
12 | </condition>
|
---|
13 | <condition property="HTMLHelpCompiler" value="C:\Program Files (x86)\HTML Help Workshop\hhc.exe">
|
---|
14 | <available file="C:\Program Files (x86)\HTML Help Workshop\hhc.exe"/>
|
---|
15 | </condition>
|
---|
16 | <property name="preprocess.copy-generated-files.skip" value="true"/>
|
---|
17 | <property name="doc.dir" location="${basedir}/docsrc"/>
|
---|
18 | <property name="css.dir" location="${basedir}/css"/>
|
---|
19 | <property name="resource.dir" location="${basedir}/resource"/>
|
---|
20 | <property name="message.xsl" location="${resource.dir}/messages.xsl"/>
|
---|
21 | <property name="message.input" location="${resource.dir}/messages.xml"/>
|
---|
22 | <property name="message.outputtopic" location="${doc.dir}/readme/DITA-messages.xml"/>
|
---|
23 | <property name="doc.out.dir" location="${basedir}/doc"/>
|
---|
24 | </target>
|
---|
25 |
|
---|
26 | <target name="generate-msg-topic" depends="init" description="Regenerate message file">
|
---|
27 | <ant antfile="${basedir}/integrator.xml"/>
|
---|
28 | <xslt in="${message.input}" out="${message.outputtopic}" style="${message.xsl}"/>
|
---|
29 | </target>
|
---|
30 |
|
---|
31 | <target name="generate-platform-filter" depends="init" description="Genrate platform filter file">
|
---|
32 | <condition property="platform" value="windows">
|
---|
33 | <and>
|
---|
34 | <os family="windows"/>
|
---|
35 | <not><isset property="platform"/></not>
|
---|
36 | </and>
|
---|
37 | </condition>
|
---|
38 | <condition property="platform" value="osx">
|
---|
39 | <and>
|
---|
40 | <os family="mac"/>
|
---|
41 | <not><isset property="platform"/></not>
|
---|
42 | </and>
|
---|
43 | </condition>
|
---|
44 | <condition property="platform" value="unix">
|
---|
45 | <and>
|
---|
46 | <os family="unix"/>
|
---|
47 | <not><isset property="platform"/></not>
|
---|
48 | </and>
|
---|
49 | </condition>
|
---|
50 | <echoxml file="${doc.dir}/platform.ditaval">
|
---|
51 | <val>
|
---|
52 | <prop action="include" att="platform" val="${platform}"/>
|
---|
53 | <prop action="exclude" att="platform"/>
|
---|
54 | </val>
|
---|
55 | </echoxml>
|
---|
56 | </target>
|
---|
57 |
|
---|
58 | <target name="filter-platform" depends="init, generate-platform-filter" description="Filter output by current platform">
|
---|
59 | <property name="args.filter" location="${doc.dir}/platform.ditaval"/>
|
---|
60 | </target>
|
---|
61 |
|
---|
62 | <target name="build-pdf" depends="generate-msg-topic" description="Build User Guide to PDF">
|
---|
63 | <ant antfile="${basedir}/build.xml">
|
---|
64 | <property name="args.input" location="${doc.dir}/userguide-book.ditamap"/>
|
---|
65 | <property name="output.dir" location="${doc.out.dir}"/>
|
---|
66 | <property name="outputFile.base" value="userguide"/>
|
---|
67 | <property name="transtype" value="pdf"/>
|
---|
68 | </ant>
|
---|
69 | </target>
|
---|
70 |
|
---|
71 | <target name="build-htmlhelp" depends="generate-msg-topic" description="Build User Guide to CHM">
|
---|
72 | <ant antfile="${basedir}/build.xml">
|
---|
73 | <property name="args.input" location="${doc.dir}/userguide.ditamap"/>
|
---|
74 | <property name="output.dir" location="${doc.out.dir}/htmlhelp"/>
|
---|
75 | <property name="args.gen.task.lbl" value="YES"/>
|
---|
76 | <property name="args.css" value="dita-ot-doc.css"/>
|
---|
77 | <property name="args.cssroot" value="${doc.dir}/resource"/>
|
---|
78 | <property name="args.copycss" value="yes"/>
|
---|
79 | <property name="transtype" value="htmlhelp"/>
|
---|
80 | </ant>
|
---|
81 | <move todir="${doc.out.dir}" failonerror="no">
|
---|
82 | <fileset dir="${doc.out.dir}/htmlhelp" includes="*.chm"/>
|
---|
83 | </move>
|
---|
84 | <delete dir="${doc.out.dir}/htmlhelp"/>
|
---|
85 | </target>
|
---|
86 |
|
---|
87 | <target name="build-html" depends="generate-msg-topic" description="Build User Guide to XHTML">
|
---|
88 | <ant antfile="${basedir}/build.xml">
|
---|
89 | <property name="args.input" location="${doc.dir}/userguide.ditamap"/>
|
---|
90 | <property name="output.dir" location="${doc.out.dir}"/>
|
---|
91 | <property name="outputFile.base" value="index"/>
|
---|
92 | <property name="args.gen.task.lbl" value="YES"/>
|
---|
93 | <property name="args.css" value="dita-ot-doc.css"/>
|
---|
94 | <property name="args.cssroot" value="${doc.dir}/resource"/>
|
---|
95 | <property name="args.copycss" value="yes"/>
|
---|
96 | <property name="transtype" value="tocjs"/>
|
---|
97 | </ant>
|
---|
98 | <move file="${doc.out.dir}/userguide.html" tofile="${doc.out.dir}/index.html"/>
|
---|
99 | </target>
|
---|
100 |
|
---|
101 | <target name="all" description="Build all documentation" depends="build-pdf, build-htmlhelp, build-html"/>
|
---|
102 |
|
---|
103 | </project>
|
---|