]> git.stg.codes - stg.git/blob - doc/xslt/webhelp/build.xml
Set output encoding to utf-8.
[stg.git] / doc / xslt / webhelp / build.xml
1 <project default="help" name="mainbuild">
2
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"/>
6
7   <property name="extensions.dir" value="${ant.file.dir}/../extensions"/>
8
9     <path id="classpath">
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"/>
13     </path>
14
15   <condition property="perform-validation-dtd">
16         <equals arg1="${validate-against-dtd}" arg2="true"/>
17   </condition>
18   <condition property="do-search-indexing">
19         <equals arg1="${webhelp.include.search.tab}" arg2="true"/>
20   </condition>
21
22   <target name="validate" if="perform-validation-dtd">
23     <xmlvalidate file="${input-xml}" classname="org.apache.xerces.parsers.SAXParser"/>
24   </target>
25
26   <target name="chunk" depends="clean">
27         
28         <mkdir dir="${output-dir}"/>
29         <xslt
30           in="${input-xml}"
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"/>
40         </xslt>
41         
42         <delete file="${output-dir}/dummy.html"/>
43
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/**"/>
49           </fileset>
50         </copy>
51
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}" />
58         </copy>
59   </target>
60
61   <target name="index" if="do-search-indexing">
62
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/*"/>
68           </fileset>
69         </copy>
70
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"/>
78           </fileset>
79         </copy>
80  
81         <taskdef name="indexertask"
82           classname="com.nexwave.nquindexer.IndexerTask">
83           <classpath refid="classpath"/>
84         </taskdef>
85
86         <echo>Indexing html files in ${output-dir}/content</echo>
87
88         <indexertask htmldir="${output-dir}/content" indexerLanguage="${webhelp.indexer.language}"/>
89
90         <delete>
91           <fileset dir="${output-dir}/content/search" includes="*.props"/>
92         </delete>
93
94   </target>
95
96   <target name="webhelp" depends="validate,chunk,index"/>
97
98
99   <target name="clean">
100         <delete dir="${output-dir}"/>
101   </target>
102
103   <target name="help">
104         <echo>
105 Usage:
106 webhelp:       Generates the document in webhelp format and indexes the content.
107 clean:         Deletes webhelp output directory.
108 index:         Indexes the content.
109         </echo>
110   </target>
111
112 </project>