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. 2006 All Rights Reserved. -->
|
---|
6 | <project name="dita2htmlhelp">
|
---|
7 |
|
---|
8 | <target name="dita2htmlhelp"
|
---|
9 | unless="noMap"
|
---|
10 | depends="build-init, use-init.envhhcdir, use-init.hhcdir, preprocess, copy-css,
|
---|
11 | dita.topics.html, dita.inner.topics.html, dita.outer.topics.html">
|
---|
12 | <antcall target="dita.map.htmlhelp"></antcall>
|
---|
13 |
|
---|
14 | <antcall target="dita.htmlhelp.convertlang"></antcall>
|
---|
15 |
|
---|
16 | <antcall target="compile.HTML.Help"></antcall>
|
---|
17 | </target>
|
---|
18 |
|
---|
19 |
|
---|
20 | <target name="use-init.envhhcdir" if="env.HHCDIR">
|
---|
21 | <available file="${env.HHCDIR}${file.separator}hhc.exe" property="HTMLHelpCompiler"
|
---|
22 | value="${env.HHCDIR}${file.separator}hhc.exe"/>
|
---|
23 | </target>
|
---|
24 |
|
---|
25 | <target name="use-init.hhcdir" unless="env.HHCDIR">
|
---|
26 | <condition property="hhc.dir" value="C:\Program Files (x86)\HTML Help Workshop" else="C:\Program Files\HTML Help Workshop">
|
---|
27 | <available file="C:\Program Files (x86)\HTML Help Workshop" type="dir"/>
|
---|
28 | </condition>
|
---|
29 | <available file="${hhc.dir}${file.separator}hhc.exe" property="HTMLHelpCompiler"
|
---|
30 | value="${hhc.dir}${file.separator}hhc.exe" />
|
---|
31 | </target>
|
---|
32 |
|
---|
33 | <target name="dita.map.htmlhelp"
|
---|
34 | depends="dita.map.htmlhelp.init, dita.map.htmlhelp.hhp, dita.map.htmlhelp.hhc, dita.map.htmlhelp.hhk, dita.out.map.htmlhelp.hhp, dita.out.map.htmlhelp.hhc, dita.out.map.htmlhelp.hhk">
|
---|
35 | </target>
|
---|
36 |
|
---|
37 | <target name="dita.map.htmlhelp.init"
|
---|
38 | description="Init properties for HTMLHelp">
|
---|
39 | <condition property="out.ext" value=".html">
|
---|
40 | <not>
|
---|
41 | <isset property="out.ext" />
|
---|
42 | </not>
|
---|
43 | </condition>
|
---|
44 | </target>
|
---|
45 |
|
---|
46 | <target name="dita.map.htmlhelp.hhp"
|
---|
47 | depends="dita.map.htmlhelp.init" if="old.transform"
|
---|
48 | description="Build HTMLHelp HHP file">
|
---|
49 | <xslt
|
---|
50 | basedir="${dita.temp.dir}"
|
---|
51 | destdir="${output.dir}"
|
---|
52 | includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
|
---|
53 | extension=".hhp"
|
---|
54 | classpathref="dost.class.path"
|
---|
55 | style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhp.xsl">
|
---|
56 | <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
|
---|
57 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
58 | <param name="OUTEXT" expression="${out.ext}" if="out.ext" />
|
---|
59 | <param name="HHCNAME" expression="${dita.map.filename.root}.hhc" />
|
---|
60 | <param name="INCLUDEFILE"
|
---|
61 | expression="${args.htmlhelp.includefile}"
|
---|
62 | if="args.htmlhelp.includefile" />
|
---|
63 | <xmlcatalog refid="dita.catalog"/>
|
---|
64 | </xslt>
|
---|
65 | </target>
|
---|
66 |
|
---|
67 | <target name="dita.out.map.htmlhelp.hhp"
|
---|
68 | depends="dita.map.htmlhelp.init" if="inner.transform"
|
---|
69 | description="Build HTMLHelp HHP file">
|
---|
70 | <xslt
|
---|
71 | basedir="${dita.temp.dir}"
|
---|
72 | destdir="${output.dir}"
|
---|
73 | includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
|
---|
74 | classpathref="dost.class.path"
|
---|
75 | style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhp.xsl">
|
---|
76 | <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
|
---|
77 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
78 | <param name="OUTEXT" expression="${out.ext}" if="out.ext" />
|
---|
79 | <param name="HHCNAME" expression="${dita.map.filename.root}.hhc" />
|
---|
80 | <param name="INCLUDEFILE"
|
---|
81 | expression="${args.htmlhelp.includefile}"
|
---|
82 | if="args.htmlhelp.includefile" />
|
---|
83 | <mapper type="glob" from="${user.input.file}" to="${dita.map.filename.root}.hhp"/>
|
---|
84 | <xmlcatalog refid="dita.catalog"/>
|
---|
85 | </xslt>
|
---|
86 | </target>
|
---|
87 |
|
---|
88 | <target name="dita.map.htmlhelp.hhc"
|
---|
89 | depends="dita.map.htmlhelp.init" if="old.transform"
|
---|
90 | description="Build HTMLHelp HHC file">
|
---|
91 | <xslt
|
---|
92 | basedir="${dita.temp.dir}"
|
---|
93 | destdir="${output.dir}"
|
---|
94 | includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
|
---|
95 | extension=".hhc"
|
---|
96 | classpathref="dost.class.path"
|
---|
97 | style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhc.xsl">
|
---|
98 | <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
|
---|
99 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
100 | <param name="OUTEXT" expression="${out.ext}" if="out.ext" />
|
---|
101 | <xmlcatalog refid="dita.catalog"/>
|
---|
102 | </xslt>
|
---|
103 | </target>
|
---|
104 |
|
---|
105 | <target name="dita.out.map.htmlhelp.hhc"
|
---|
106 | depends="dita.map.htmlhelp.init" if="inner.transform"
|
---|
107 | description="Build HTMLHelp HHC file">
|
---|
108 | <xslt
|
---|
109 | basedir="${dita.temp.dir}"
|
---|
110 | destdir="${output.dir}"
|
---|
111 | includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
|
---|
112 | classpathref="dost.class.path"
|
---|
113 | style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhc.xsl">
|
---|
114 | <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
|
---|
115 | <param name="DITAEXT" expression="${dita.ext}" if="dita.ext" />
|
---|
116 | <param name="OUTEXT" expression="${out.ext}" if="out.ext" />
|
---|
117 | <mapper type="glob" from="${user.input.file}" to="${dita.map.filename.root}.hhc"/>
|
---|
118 | <xmlcatalog refid="dita.catalog"/>
|
---|
119 | </xslt>
|
---|
120 | </target>
|
---|
121 |
|
---|
122 | <target name="dita.map.htmlhelp.hhk"
|
---|
123 | depends="dita.map.htmlhelp.init" if="old.transform"
|
---|
124 | description="Build HTMLHelp HHK file">
|
---|
125 | <pipeline message="Extract index term."
|
---|
126 | tempdir="${dita.temp.dir}"
|
---|
127 | inputmap="${user.input.file}">
|
---|
128 | <module class="org.dita.dost.module.IndexTermExtractModule">
|
---|
129 | <param name="output" location="${output.dir}${file.separator}${user.input.file}"/>
|
---|
130 | <param name="targetext" value="${out.ext}"/>
|
---|
131 | <param name="indextype" value="htmlhelp"/>
|
---|
132 | <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
|
---|
133 | </module>
|
---|
134 | </pipeline>
|
---|
135 | </target>
|
---|
136 |
|
---|
137 | <target name="dita.out.map.htmlhelp.hhk"
|
---|
138 | depends="dita.map.htmlhelp.init" if="inner.transform"
|
---|
139 | description="Build HTMLHelp HHK file">
|
---|
140 | <pipeline message="Extract index term."
|
---|
141 | tempdir="${dita.temp.dir}"
|
---|
142 | inputmap="${user.input.file}">
|
---|
143 | <module class="org.dita.dost.module.IndexTermExtractModule">
|
---|
144 | <param name="output" location="${output.dir}${file.separator}${dita.map.filename.root}.hhk"/>
|
---|
145 | <param name="targetext" value="${out.ext}"/>
|
---|
146 | <param name="indextype" value="htmlhelp"/>
|
---|
147 | <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
|
---|
148 | </module>
|
---|
149 | </pipeline>
|
---|
150 | </target>
|
---|
151 |
|
---|
152 | <target name="dita.htmlhelp.convertlang">
|
---|
153 | <taskdef name="check-lang" classname="org.dita.dost.util.CheckLang">
|
---|
154 | <classpath refid="dost.jar.path" />
|
---|
155 | </taskdef>
|
---|
156 | <taskdef name="convert-lang" classname="org.dita.dost.util.ConvertLang">
|
---|
157 | <classpath refid="dost.jar.path" />
|
---|
158 | </taskdef>
|
---|
159 |
|
---|
160 | <check-lang message="Check Language"
|
---|
161 | basedir="${basedir}"
|
---|
162 | tempdir="${dita.temp.dir}"
|
---|
163 | inputmap="${user.input.file}"
|
---|
164 | outputdir="${output.dir}"/>
|
---|
165 |
|
---|
166 | <convert-lang message="Convert Language"
|
---|
167 | basedir="${basedir}"
|
---|
168 | outputdir="${output.dir}"
|
---|
169 | langcode="${htmlhelp.locale}"/>
|
---|
170 | </target>
|
---|
171 |
|
---|
172 | <target name="compile.HTML.Help"
|
---|
173 | if="HTMLHelpCompiler"
|
---|
174 | description="Compile HTMLHelp output">
|
---|
175 | <condition property="compile.dir" value="${output.dir}">
|
---|
176 | <isset property="inner.transform"/>
|
---|
177 | </condition>
|
---|
178 | <condition property="compile.dir" value="${dita.map.output.dir}">
|
---|
179 | <isset property="old.transform"/>
|
---|
180 | </condition>
|
---|
181 | <exec executable="${HTMLHelpCompiler}"
|
---|
182 | failonerror="${failonerror}"
|
---|
183 | failifexecutionfails="${failonerror}">
|
---|
184 | <arg value="${compile.dir}${file.separator}${dita.map.filename.root}.hhp" />
|
---|
185 | </exec>
|
---|
186 | </target>
|
---|
187 |
|
---|
188 | <!-- depecrated: keep for back-compatibility, will be remvoed in a later release -->
|
---|
189 | <target name="dita.topics.htmlhelp" depends="dita.topics.html" />
|
---|
190 |
|
---|
191 | </project>
|
---|