1 <project default="help" name="mainbuild">
 
   3   <dirname property="ant.file.dir" file="${ant.file.mainbuild}"/>
 
   4   <loadproperties srcFile="${ant.file.dir}/build.properties"/>
 
   5   <property name="webhelp.include.search.tab" value="true"/>
 
   7   <property name="extensions.dir" value="${ant.file.dir}/../extensions"/>
 
  10         <pathelement location="${extensions.dir}/webhelpindexer.jar"/>
 
  11         <pathelement location="${extensions.dir}/lucene-analyzers-3.0.0.jar"/>
 
  12         <pathelement location="${extensions.dir}/lucene-core-3.0.0.jar"/>
 
  15   <condition property="perform-validation-dtd">
 
  16         <equals arg1="${validate-against-dtd}" arg2="true"/>
 
  18   <condition property="do-search-indexing">
 
  19         <equals arg1="${webhelp.include.search.tab}" arg2="true"/>
 
  22   <target name="validate" if="perform-validation-dtd">
 
  23     <xmlvalidate file="${input-xml}" classname="org.apache.xerces.parsers.SAXParser"/>
 
  26   <target name="chunk" depends="clean">
 
  28         <mkdir dir="${output-dir}"/>
 
  31           out="${output-dir}/dummy.html"
 
  32           style="${stylesheet-path}"
 
  33           scanincludeddirectories="false"
 
  34           classpath="${xslt-processor-classpath}">
 
  35           <param name="webhelp.include.search.tab" expression="${webhelp.include.search.tab}"
 
  36                 if="webhelp.include.search.tab"/>
 
  37           <param name="output_file_name" expression="${output_file_name}"/>
 
  38           <param name="webhelp.base.dir" expression="${output-dir}" if="output-dir"/>
 
  39           <param name="webhelp.indexer.language" expression="${webhelp.indexer.language}" if="webhelp.indexer.language"/>
 
  42         <delete file="${output-dir}/dummy.html"/>
 
  44         <!-- Copy common content such as js files of tree, css etc. to template folder. They will be copied to doc folder. They are NOT page specific! -->
 
  45         <copy todir="${output-dir}">
 
  46           <fileset dir="${ant.file.dir}/template">
 
  47                 <include name="**/*"/>
 
  48                 <exclude name="**/content/search/**"/>
 
  52         <!-- Very simple-minded copy to handle the source document's images -->
 
  53         <!-- TODO: Look at html help code that produces a manifest file...list of images -->
 
  54         <!--       Customize webhelp.xsl to produce ant file to copy images actually used? -->
 
  55         <dirname property="input-images-basedir" file="${input-xml}"/>
 
  56         <copy todir="${output-dir}/content" failonerror="false">
 
  57           <fileset dir="${input-images-basedir}" includes="${input-images-dirs}" />
 
  61   <target name="index" if="do-search-indexing">
 
  63         <copy todir="${output-dir}">
 
  64           <fileset dir="${ant.file.dir}/template">
 
  65                 <include name="**/*"/>
 
  66                 <exclude name="**/content/search/*.props"/>
 
  67                 <exclude name="**/content/search/stemmers/*"/>
 
  71         <!-- We separate this out so we only copy the stopwords list and stemmer for the indexer language -->
 
  72         <copy todir="${output-dir}">
 
  73           <fileset dir="${ant.file.dir}/template">
 
  74                 <include name="**/content/search/default.props"/>
 
  75                 <include name="**/content/search/punctuation.props"/>
 
  76                 <include name="**/content/search/${webhelp.indexer.language}*.props"/>
 
  77                 <include name="**/content/search/stemmers/${webhelp.indexer.language}_stemmer.js"/>
 
  81         <taskdef name="indexertask"
 
  82           classname="com.nexwave.nquindexer.IndexerTask">
 
  83           <classpath refid="classpath"/>
 
  86         <echo>Indexing html files in ${output-dir}/content</echo>
 
  88         <indexertask htmldir="${output-dir}/content" indexerLanguage="${webhelp.indexer.language}"/>
 
  91           <fileset dir="${output-dir}/content/search" includes="*.props"/>
 
  96   <target name="webhelp" depends="validate,chunk,index"/>
 
 100         <delete dir="${output-dir}"/>
 
 106 webhelp:       Generates the document in webhelp format and indexes the content.
 
 107 clean:         Deletes webhelp output directory.
 
 108 index:         Indexes the content.