| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- This file is part of the DITA Open Toolkit project.
- See the accompanying license.txt file for applicable licenses.-->
- <!-- (c) Copyright IBM Corp. 2006 All Rights Reserved. -->
- <project name="dita2htmlhelp">
- <target name="dita2htmlhelp" unless="noMap"
- depends="dita2htmlhelp.init,
- build-init,
- use-init.envhhcdir,
- use-init.hhcdir,
- preprocess,
- xhtml.topics,
- copy-css">
- <antcall target="dita.map.htmlhelp"/>
- <antcall target="dita.htmlhelp.convertlang"/>
- <antcall target="compile.HTML.Help"/>
- </target>
- <target name="dita2htmlhelp.init">
- <property name="html-version" value="html"/>
- </target>
- <target name="use-init.envhhcdir" if="env.HHCDIR">
- <available file="${env.HHCDIR}/hhc.exe"
- property="HTMLHelpCompiler"
- value="${env.HHCDIR}${file.separator}hhc.exe"/>
- </target>
- <target name="use-init.hhcdir" unless="env.HHCDIR">
- <condition property="hhc.dir"
- value="${env.ProgramFiles(x86)}\HTML Help Workshop"
- else="${env.ProgramFiles}\HTML Help Workshop">
- <available file="${env.ProgramFiles(x86)}\HTML Help Workshop" type="dir"/>
- </condition>
- <available file="${hhc.dir}/hhc.exe"
- property="HTMLHelpCompiler"
- value="${hhc.dir}${file.separator}hhc.exe"/>
- </target>
- <target name="dita.map.htmlhelp"
- depends="dita.map.htmlhelp.init,
- dita.map.htmlhelp.hhp,
- dita.map.htmlhelp.hhc,
- dita.map.htmlhelp.hhk"/>
- <target name="dita.map.htmlhelp.init" description="Init properties for HTMLHelp">
- <condition property="out.ext" value=".html">
- <not>
- <isset property="out.ext"/>
- </not>
- </condition>
- </target>
- <target name="dita.map.htmlhelp.hhp" depends="dita.map.htmlhelp.init"
- description="Build HTMLHelp HHP file">
- <local name="htmlhelp.hhp.output.dir"/>
- <condition property="htmlhelp.hhp.output.dir" value="${output.dir}" else="${_dita.map.output.dir}">
- <isset property="inner.transform"/>
- </condition>
- <xslt basedir="${dita.temp.dir}"
- destdir="${htmlhelp.hhp.output.dir}"
- includesfile="${dita.temp.dir}/${user.input.file.listfile}"
- classpathref="dost.class.path"
- style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhp.xsl">
- <excludesfile name="${dita.temp.dir}/${resourceonlyfile}" if="resourceonlyfile"/>
- <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
- <param name="HHCNAME" expression="${dita.map.filename.root}.hhc"/>
- <param name="INCLUDEFILE" expression="${args.htmlhelp.includefile}" if="args.htmlhelp.includefile"/>
- <param name="defaultLanguage" expression="${default.language}"/>
- <xmlcatalog refid="dita.catalog"/>
- <mergemapper to="${dita.map.filename.root}.hhp"/>
- </xslt>
- </target>
- <!-- Deprecated since 2.1 -->
- <target name="dita.out.map.htmlhelp.hhp" depends="dita.map.htmlhelp.init" if="inner.transform"
- description="Build HTMLHelp HHP file">
- <dita-ot-echo id="DOTX070W"><param name="1" value="dita.out.map.htmlhelp.hhp"/></dita-ot-echo>
- <xslt basedir="${dita.temp.dir}"
- destdir="${output.dir}"
- includesfile="${dita.temp.dir}/${user.input.file.listfile}"
- classpathref="dost.class.path"
- style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhp.xsl">
- <excludesfile name="${dita.temp.dir}/${resourceonlyfile}" if="resourceonlyfile"/>
- <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
- <param name="HHCNAME" expression="${dita.map.filename.root}.hhc"/>
- <param name="INCLUDEFILE" expression="${args.htmlhelp.includefile}" if="args.htmlhelp.includefile"/>
- <mapper type="glob" from="${user.input.file}" to="${dita.map.filename.root}.hhp"/>
- <xmlcatalog refid="dita.catalog"/>
- </xslt>
- </target>
- <target name="dita.map.htmlhelp.hhc" depends="dita.map.htmlhelp.init"
- description="Build HTMLHelp HHC file">
- <local name="htmlhelp.hhc.output.dir"/>
- <condition property="htmlhelp.hhc.output.dir" value="${output.dir}" else="${_dita.map.output.dir}">
- <isset property="inner.transform"/>
- </condition>
- <xslt basedir="${dita.temp.dir}"
- destdir="${htmlhelp.hhc.output.dir}"
- includesfile="${dita.temp.dir}/${user.input.file.listfile}"
- classpathref="dost.class.path"
- style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhc.xsl">
- <excludesfile name="${dita.temp.dir}/${resourceonlyfile}" if="resourceonlyfile"/>
- <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
- <param name="defaultLanguage" expression="${default.language}"/>
- <xmlcatalog refid="dita.catalog"/>
- <mergemapper to="${dita.map.filename.root}.hhc"/>
- </xslt>
- </target>
- <!-- Deprecated since 2.1 -->
- <target name="dita.out.map.htmlhelp.hhc" depends="dita.map.htmlhelp.init" if="inner.transform"
- description="Build HTMLHelp HHC file">
- <dita-ot-echo id="DOTX070W"><param name="1" value="dita.out.map.htmlhelp.hhc"/></dita-ot-echo>
- <xslt basedir="${dita.temp.dir}"
- destdir="${output.dir}"
- includesfile="${dita.temp.dir}/${user.input.file.listfile}"
- classpathref="dost.class.path"
- style="${dita.plugin.org.dita.htmlhelp.dir}/xsl/map2hhc.xsl">
- <excludesfile name="${dita.temp.dir}/${resourceonlyfile}" if="resourceonlyfile"/>
- <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
- <mapper type="glob" from="${user.input.file}" to="${dita.map.filename.root}.hhc"/>
- <xmlcatalog refid="dita.catalog"/>
- </xslt>
- </target>
- <target name="dita.map.htmlhelp.hhk" depends="dita.map.htmlhelp.init"
- description="Build HTMLHelp HHK file">
- <local name="htmlhelp.hhk.output.dir"/>
- <condition property="htmlhelp.hhk.output.dir" value="${output.dir}" else="${_dita.map.output.dir}">
- <isset property="inner.transform"/>
- </condition>
- <pipeline message="Extract index term." tempdir="${dita.temp.dir}" inputmap="${user.input.file}">
- <module class="org.dita.dost.module.IndexTermExtractModule">
- <param name="output" location="${htmlhelp.hhk.output.dir}/${dita.map.filename.root}.hhk"/>
- <param name="targetext" value="${out.ext}"/>
- <param name="indextype" value="htmlhelp"/>
- <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
- <param name="defaultLanguage" expression="${default.language}"/>
- </module>
- </pipeline>
- </target>
- <!-- Deprecated since 2.1 -->
- <target name="dita.out.map.htmlhelp.hhk" depends="dita.map.htmlhelp.init" if="inner.transform"
- description="Build HTMLHelp HHK file">
- <dita-ot-echo id="DOTX070W"><param name="1" value="dita.out.map.htmlhelp.hhk"/></dita-ot-echo>
- <pipeline message="Extract index term." tempdir="${dita.temp.dir}" inputmap="${user.input.file}">
- <module class="org.dita.dost.module.IndexTermExtractModule">
- <param name="output" location="${output.dir}/${dita.map.filename.root}.hhk"/>
- <param name="targetext" value="${out.ext}"/>
- <param name="indextype" value="htmlhelp"/>
- <param name="encoding" value="${args.dita.locale}" if="args.dita.locale"/>
- </module>
- </pipeline>
- </target>
- <target name="dita.htmlhelp.convertlang">
- <taskdef name="check-lang" classname="org.dita.dost.util.CheckLang">
- <classpath refid="dost.class.path"/>
- </taskdef>
- <taskdef name="convert-lang" classname="org.dita.dost.util.ConvertLang">
- <classpath refid="dost.class.path"/>
- </taskdef>
- <check-lang message="Check Language"
- basedir="${basedir}"
- tempdir="${dita.temp.dir}"
- inputmap="${user.input.file}"
- outputdir="${output.dir}"/>
- <convert-lang message="Convert Language"
- basedir="${basedir}"
- outputdir="${output.dir}"
- langcode="${htmlhelp.locale}"/>
- </target>
- <target name="compile.HTML.Help" if="HTMLHelpCompiler" description="Compile HTMLHelp output">
- <condition property="compile.dir" value="${output.dir}">
- <isset property="inner.transform"/>
- </condition>
- <condition property="compile.dir" value="${dita.map.output.dir}">
- <isset property="old.transform"/>
- </condition>
- <exec executable="${HTMLHelpCompiler}"
- failonerror="${failonerror}"
- failifexecutionfails="${failonerror}">
- <arg value="${compile.dir}${file.separator}${dita.map.filename.root}.hhp"/>
- </exec>
- </target>
- </project>
|