3 ============================================================
4 $Date: 2008-12-16 22:51:06 +0800 (Tue, 16 Dec 2008) $
7 ============================================================
9 Customization layer for build files.
11 You can override these settings by defining them on the command line or by
12 defining them in doc.build.user which is included here if it exists.
14 Example content of doc.build.user:
15 <property name="applications" value="TortoiseGit, TortoiseMerge" />
16 <property name="docformats" value="chm" />
17 <property name="languages" value="en" />
19 This will only build the english HTML help file for TortoiseGit
23 <project name=
"customize">
24 <description>Customization layer for build file
</description>
26 <include buildfile=
"doc.build.user" if=
"${file::exists('doc.build.user')}"/>
28 <!-- ============================================================ -->
29 <!-- List of applications, languages and output formats in which -->
30 <!-- the documentation will be created by default -->
32 <property name=
"applications"
33 value=
"TortoiseGit,TortoiseMerge"
34 unless=
"${property::exists('applications')}"
37 <!-- pdf,chm,html,htmlsingle -->
38 <property name=
"docformats"
40 unless=
"${property::exists('docformats')}"
43 <!--,de,es,fa,fi,fr,hr,id,ja,nl,ru,sl,sk,sr_spc,sr_spl,zh_CN" -->
44 <property name=
"languages"
46 unless=
"${property::exists('languages')}"
49 <!-- ============================================================ -->
50 <!-- Define property so that doc.build alone doesn't fail -->
52 <property name=
"devrelease"
54 unless=
"${property::exists('devrelease')}"
57 <property name=
"critical" value=
"${devrelease!='-dev'}" />
59 <!-- ============================================================ -->
60 <!-- Settings for the translation -->
62 <!-- Base language. All other documents are created using this -->
63 <!-- documents structure -->
64 <property name=
"lang.base"
66 unless=
"${property::exists('lang.base')}"
69 <!-- ============================================================ -->
70 <!-- Settings for the CHM Help creation -->
71 <!-- Attention, this is implemented as a target, because I could -->
72 <!-- not find a better way to create the property depending on -->
75 <target name=
"help.prepare.TortoiseGit">
76 <echo message=
"help.prepare.TortoiseGit"/>
77 <property name=
"help.resource.TortoiseGit"
78 value=
"../src/TortoiseProc/resource.h"
79 unless=
"${property::exists('help.resource.TortoiseGit')}"
81 <property name=
"help.resource" value=
"${help.resource.TortoiseGit}" />
83 <target name=
"help.prepare.TortoiseMerge">
84 <echo message=
"help.prepare.TortoiseMerge"/>
85 <property name=
"help.resource.TortoiseMerge"
86 value=
"../src/TortoiseMerge/resource.h"
87 unless=
"${property::exists('help.resource.TortoiseMerge')}"
89 <property name=
"help.resource" value=
"${help.resource.TortoiseMerge}" />
92 <!-- Fileset to exclude from translation and .pot creation -->
93 <!-- Duplicate these files in the "sourcefiles" fileset -->
95 <fileset id="files.exclude">
96 <include name="source/${lang.base}/**/version.xml"/>
99 <fileset id="files.filtered">
100 <include name="source/${lang.base}/TortoiseGit/**/*.xml"/>
101 <include name="source/${lang.base}/**/wishlist.xml"/>
102 <exclude name="source/${lang.base}/**/version.xml"/>
106 <!-- Name of the po template file to create. Can also be a list -->
107 <!-- of applications if you want to create a template for each -->
108 <property name=
"potemplates" value=
"${applications}" />
110 <!-- ============================================================ -->
111 <!-- Paths to the binaries -->
112 <property name=
"path.bin"
113 value=
"${path::get-full-path('../Tools')}"
114 unless=
"${property::exists('path.bin')}"
116 <property name=
"path.fop"
117 value=
"${path::get-full-path('../Tools/fop')}"
118 unless=
"${property::exists('path.fop')}"
120 <property name=
"path.xsl"
121 value=
"${string::replace(path::get-full-path('../Tools/xsl'), '\', '/')}"
122 unless=
"${property::exists('path.xsl')}"
124 <property name=
"path.gettext"
125 value=
"${path::get-full-path('../Tools')}"
126 unless=
"${property::exists('path.gettext')}"
129 <!-- ============================================================ -->
130 <!-- Settings for XSLTPROC -->
132 <!-- Paths where the xsl and css files are found -->
133 <property name=
"path.user.xsl" value=
"./xsl"/>
134 <property name=
"path.user.css" value=
"./source"/>
136 <!-- stylesheets and stringparams -->
137 <property name=
"xsl.pdf.params" value=
"--nonet --xinclude"/>
138 <property name=
"xsl.pdf.file" value=
"pdfdoc.xsl"/>
139 <property name=
"xsl.chm.params" value=
"--nonet --xinclude --stringparam chunker.output.encoding UTF-8 --stringparam html.stylesheet styles_chm.css --stringparam use.id.as.filename 1"/>
140 <property name=
"xsl.chm.file" value=
"htmlhelp.xsl"/>
141 <property name=
"xsl.html.params" value=
"--nonet --xinclude --stringparam chunker.output.encoding UTF-8 --stringparam html.stylesheet styles_html.css --stringparam use.id.as.filename 1"/>
142 <property name=
"xsl.html.file" value=
"htmlsingle.xsl"/>
143 <property name=
"xsl.htmlsingle.params" value=
"--nonet --xinclude --stringparam chunker.output.encoding UTF-8 --stringparam html.stylesheet styles_html.css --stringparam use.id.as.filename 1"/>
144 <property name=
"xsl.htmlsingle.file" value=
"htmlchunk.xsl"/>
145 <property name=
"xsl.profile.params" value=
"--nonet --xinclude --stringparam profile.condition "exclude""/>
146 <property name=
"xsl.profile.file" value=
"profile.xsl"/>
148 <!-- ====================================================================== -->
149 <!-- Custom target to prepare the build -->
150 <!-- ====================================================================== -->
152 <target name=
"prepare.custom"
153 description=
"Prepare XSL files, create help context file"
154 depends=
"PrepareVersionInfo">
156 <!-- Delete CHM help context files to force re-creation -->
157 <delete file=
"source/TortoiseGit.h" if=
"${file::exists('source/TortoiseGit.h')}"/>
158 <delete file=
"source/TortoiseMerge.h" if=
"${file::exists('source/TortoiseMerge.h')}"/>
160 <!-- Store path to docbook stylesheets in helper stylesheets -->
161 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_pdfdoc.xsl"/>
162 <echo message=
"<xsl:import href="${path.xsl}/fo/docbook.xsl"/>" file=
"${path.user.xsl}/db_pdfdoc.xsl" append=
"true"/>
163 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_pdfdoc.xsl" append=
"true"/>
165 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlhelp.xsl"/>
166 <echo message=
"<xsl:import href="${path.xsl}/htmlhelp/htmlhelp.xsl"/>" file=
"${path.user.xsl}/db_htmlhelp.xsl" append=
"true"/>
167 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlhelp.xsl" append=
"true"/>
169 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlsingle.xsl"/>
170 <echo message=
"<xsl:import href="${path.xsl}/html/docbook.xsl"/>" file=
"${path.user.xsl}/db_htmlsingle.xsl" append=
"true"/>
171 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlsingle.xsl" append=
"true"/>
173 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlchunk.xsl"/>
174 <echo message=
"<xsl:import href="${path.xsl}/html/chunk.xsl"/>" file=
"${path.user.xsl}/db_htmlchunk.xsl" append=
"true"/>
175 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlchunk.xsl" append=
"true"/>
179 <!-- ====================================================================== -->
180 <!-- Prepare version info for version file and output filenames -->
181 <!-- ====================================================================== -->
183 <target name=
"PrepareVersionInfo" description=
"Prepares version info for version file and output filenames">
185 <if test=
"${not environment::variable-exists('MajorVersion')}">
187 <if test=
"${file::exists('../versioninfo.build')}">
188 <!-- <echo>Note: version information set!</echo> -->
190 <if test=
"${not file::exists('../versioninfo.build')}">
191 <echo>Version information set to dummy values
</echo>
193 <variable name=
"MajorVersion" value=
"2" />
194 <variable name=
"MinorVersion" value=
"6" />
195 <variable name=
"MicroVersion" value=
"0" />
200 <property name=
"docverstring" value=
"${environment::get-variable('MajorVersion')}.${environment::get-variable('MinorVersion')}.${environment::get-variable('MicroVersion')}"/>
204 <!-- ====================================================================== -->
205 <!-- Prepare help context file -->
206 <!-- ====================================================================== -->
208 <target name=
"help.prepare" description=
"Create CHM help context">
209 <call target=
"help.prepare.${app}" />
210 <!-- if="${target::exists('help.prepare.${app}')}"/>-->
212 <property name=
"help.context" value=
"source/${app}.h"/>
213 <if test=
"${not file::exists(help.context)}">
215 <property name=
"headerfile" value=
"source/${app}_ASCII.h"/>
216 <loadfile file=
"${help.resource}" property=
"header" />
217 <echo file=
"${headerfile}" message=
"${header}" />
218 <echo message=
"header file ${help.resource}" />
220 <echo message=
"// Generated Help Map file. " file=
"${help.context}" />
221 <echo message=
"" file=
"${help.context}" append=
"true"/>
222 <echo message=
"// Commands (ID_* and IDM_*) " file=
"${help.context}" append=
"true"/>
223 <exec program=
"makehm"
224 commandline=
"/h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 ${headerfile}"
225 output=
"${help.context}"
229 <echo message=
"" file=
"${help.context}" append=
"true"/>
230 <echo message=
"// Prompts (IDP_*) " file=
"${help.context}" append=
"true"/>
231 <exec program=
"makehm"
232 commandline=
"/h IDP_,HIDP_,0x30000 ${headerfile}"
233 output=
"${help.context}"
237 <echo message=
"" file=
"${help.context}" append=
"true"/>
238 <echo message=
"// Resources (IDR_*) " file=
"${help.context}" append=
"true"/>
239 <exec program=
"makehm"
240 commandline=
"/h IDR_,HIDR_,0x20000 ${headerfile}"
241 output=
"${help.context}"
245 <echo message=
"" file=
"${help.context}" append=
"true"/>
246 <echo message=
"// Dialogs (IDD_*) " file=
"${help.context}" append=
"true"/>
247 <exec program=
"makehm"
248 commandline=
"/h IDD_,HIDD_,0x20000 ${headerfile}"
249 output=
"${help.context}"
254 <echo message="" file="${help.context}" append="true"/>
255 <echo message="// Frame Controls xyxzy(IDW_*) " file="${help.context}" append="true"/>
256 <exec program="makehm"
257 commandline="/h /a afxhh.h IDW_,HIDW_,0x50000 ${headerfile}"
258 output="${help.context}"
264 <!-- Copy help context to target location -->
265 <copy file=
"${help.context}" tofile=
"${doc.target.work}/context.h" overwrite=
"true"/>