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"
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}" />
91 <target name=
"help.prepare.Git">
92 <echo message=
"help.prepare.Git"/>
93 <property name=
"help.resource.TortoiseGit"
94 value=
"../src/TortoiseProc/resource.h"
95 unless=
"${property::exists('help.resource.TortoiseGit')}"
97 <property name=
"help.resource" value=
"${help.resource.TortoiseGit}" />
99 <!-- Fileset to exclude from translation and .pot creation -->
100 <!-- Duplicate these files in the "sourcefiles" fileset -->
102 <fileset id="files.exclude">
103 <include name="source/${lang.base}/**/version.xml"/>
104 <include name="source/${lang.base}/**/pubdate.xml"/>
107 <fileset id="files.filtered">
108 <include name="source/${lang.base}/TortoiseGit/**/*.xml"/>
109 <include name="source/${lang.base}/**/wishlist.xml"/>
110 <exclude name="source/${lang.base}/**/version.xml"/>
111 <exclude name="source/${lang.base}/**/pubdate.xml"/>
115 <!-- Name of the po template file to create. Can also be a list -->
116 <!-- of applications if you want to create a template for each -->
117 <property name=
"potemplates" value=
"${applications}" />
119 <!-- ============================================================ -->
120 <!-- Paths to the binaries -->
121 <property name=
"path.bin"
122 value=
"${path::get-full-path('../Tools')}"
123 unless=
"${property::exists('path.bin')}"
125 <property name=
"path.fop"
126 value=
"${path::get-full-path('../Tools/fop')}"
127 unless=
"${property::exists('path.fop')}"
129 <property name=
"path.xsl"
130 value=
"${string::replace(path::get-full-path('../Tools/xsl'), '\', '/')}"
131 unless=
"${property::exists('path.xsl')}"
133 <property name=
"path.gettext"
134 value=
"${path::get-full-path('../Tools')}"
135 unless=
"${property::exists('path.gettext')}"
138 <!-- Choose between 32/64 Bit executable of SubWCRev -->
139 <property name=
"bindirextension"
141 unless=
"${property::exists('bindirextension')}"
143 <property name=
"path.subwcrev"
144 value=
"../bin/release${bindirextension}/bin/"
145 unless=
"${property::exists('path.subwcrev')}"
148 <!-- ============================================================ -->
149 <!-- Settings for XSLTPROC -->
151 <!-- Paths where the xsl and css files are found -->
152 <property name=
"path.user.xsl" value=
"./xsl"/>
153 <property name=
"path.user.css" value=
"./source"/>
155 <!-- stylesheets and stringparams -->
156 <property name=
"xsl.pdf.params" value=
"--nonet --xinclude"/>
157 <property name=
"xsl.pdf.file" value=
"pdfdoc.xsl"/>
158 <property name=
"xsl.chm.params" value=
"--nonet --xinclude --stringparam html.stylesheet styles_chm.css --stringparam use.id.as.filename 1"/>
159 <property name=
"xsl.chm.file" value=
"htmlhelp.xsl"/>
160 <property name=
"xsl.html.params" value=
"--nonet --xinclude --stringparam html.stylesheet styles_html.css --stringparam use.id.as.filename 1"/>
161 <property name=
"xsl.html.file" value=
"htmlsingle.xsl"/>
162 <property name=
"xsl.htmlsingle.params" value=
"--nonet --xinclude --stringparam html.stylesheet styles_html.css --stringparam use.id.as.filename 1"/>
163 <property name=
"xsl.htmlsingle.file" value=
"htmlchunk.xsl"/>
164 <property name=
"xsl.profile.params" value=
"--nonet --xinclude --stringparam profile.condition "exclude""/>
165 <property name=
"xsl.profile.file" value=
"profile.xsl"/>
167 <!-- ====================================================================== -->
168 <!-- Custom target to prepare the build -->
169 <!-- ====================================================================== -->
171 <target name=
"prepare.custom"
172 description=
"Prepare XSL files, create help context file"
173 depends=
"PrepareVersionInfo">
175 <exec program=
"SubWCRev.exe"
176 commandline=
"source/${lang.base} source/pubdate.tmpl source/${lang.base}/pubdate.xml"
177 basedir=
"${path.subwcrev}"
179 resultproperty=
"result.subwcrev"
182 <copy file=
"source/Pubdate.none" tofile=
"source/${lang.base}/pubdate.xml" overwrite=
"true" unless=
"${result.subwcrev=='0'}"/>
184 <!-- Delete CHM help context files to force re-creation -->
185 <delete file=
"source/TortoiseGit.h" if=
"${file::exists('source/TortoiseGit.h')}"/>
186 <delete file=
"source/TortoiseMerge.h" if=
"${file::exists('source/TortoiseMerge.h')}"/>
188 <!-- Store path to docbook stylesheets in helper stylesheets -->
189 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_pdfdoc.xsl"/>
190 <echo message=
"<xsl:import href="${path.xsl}/fo/docbook.xsl"/>" file=
"${path.user.xsl}/db_pdfdoc.xsl" append=
"true"/>
191 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_pdfdoc.xsl" append=
"true"/>
193 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlhelp.xsl"/>
194 <echo message=
"<xsl:import href="${path.xsl}/htmlhelp/htmlhelp.xsl"/>" file=
"${path.user.xsl}/db_htmlhelp.xsl" append=
"true"/>
195 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlhelp.xsl" append=
"true"/>
197 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlsingle.xsl"/>
198 <echo message=
"<xsl:import href="${path.xsl}/html/docbook.xsl"/>" file=
"${path.user.xsl}/db_htmlsingle.xsl" append=
"true"/>
199 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlsingle.xsl" append=
"true"/>
201 <echo message=
"<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">" file=
"${path.user.xsl}/db_htmlchunk.xsl"/>
202 <echo message=
"<xsl:import href="${path.xsl}/html/chunk.xsl"/>" file=
"${path.user.xsl}/db_htmlchunk.xsl" append=
"true"/>
203 <echo message=
"</xsl:stylesheet>" file=
"${path.user.xsl}/db_htmlchunk.xsl" append=
"true"/>
207 <!-- ====================================================================== -->
208 <!-- Prepare version info for version file and output filenames -->
209 <!-- ====================================================================== -->
211 <target name=
"PrepareVersionInfo" description=
"Prepares version info for version file and output filenames">
213 <if test=
"${not environment::variable-exists('MajorVersion')}">
215 <if test=
"${file::exists('../versioninfo.build')}">
216 <!-- try to get version info even if full build environment is not available -->
217 <property name=
"SubWCRevFileName" value=
"${path.subwcrev}/subwcrev.exe" unless=
"${property::exists('configuration')}"/>
218 <nant target=
"versioninfo">
220 <include name=
"../versioninfo.build" />
223 <!-- <echo>Note: version information set!</echo> -->
225 <if test=
"${not file::exists('../versioninfo.build')}">
226 <echo>Version information set to dummy values
</echo>
228 <variable name=
"MajorVersion" value=
"1" />
229 <variable name=
"MinorVersion" value=
"7" />
230 <variable name=
"MicroVersion" value=
"6" />
235 <property name=
"docverstring" value=
"${environment::get-variable('MajorVersion')}.${environment::get-variable('MinorVersion')}.${environment::get-variable('MicroVersion')}"/>
239 <!-- ====================================================================== -->
240 <!-- Prepare help context file -->
241 <!-- ====================================================================== -->
243 <target name=
"help.prepare" description=
"Create CHM help context">
244 <call target=
"help.prepare.${app}" />
245 <!-- if="${target::exists('help.prepare.${app}')}"/>-->
247 <property name=
"help.context" value=
"source/${app}.h"/>
248 <if test=
"${not file::exists(help.context)}">
250 <property name=
"headerfile" value=
"source/${app}_ASCII.h"/>
251 <loadfile file=
"${help.resource}" property=
"header" />
252 <echo file=
"${headerfile}" message=
"${header}" />
253 <echo message=
"header file ${help.resource}" />
255 <echo message=
"// Generated Help Map file." file=
"${help.context}" />
256 <echo message=
"" file=
"${help.context}" append=
"true"/>
257 <echo message=
"// Commands (ID_* and IDM_*)" file=
"${help.context}" append=
"true"/>
258 <exec program=
"makehm"
259 commandline=
"/h ID_,HID_,0x10000 IDM_,HIDM_,0x10000 ${headerfile}"
260 output=
"${help.context}"
264 <echo message=
"" file=
"${help.context}" append=
"true"/>
265 <echo message=
"echo // Prompts (IDP_*)" file=
"${help.context}" append=
"true"/>
266 <exec program=
"makehm"
267 commandline=
"/h IDP_,HIDP_,0x30000 ${headerfile}"
268 output=
"${help.context}"
272 <echo message=
"" file=
"${help.context}" append=
"true"/>
273 <echo message=
"echo // Resources (IDR_*)" file=
"${help.context}" append=
"true"/>
274 <exec program=
"makehm"
275 commandline=
"/h IDR_,HIDR_,0x20000 ${headerfile}"
276 output=
"${help.context}"
280 <echo message=
"" file=
"${help.context}" append=
"true"/>
281 <echo message=
"echo // Dialogs (IDD_*)" file=
"${help.context}" append=
"true"/>
282 <exec program=
"makehm"
283 commandline=
"/h IDD_,HIDD_,0x20000 ${headerfile}"
284 output=
"${help.context}"
288 <echo message=
"" file=
"${help.context}" append=
"true"/>
289 <echo message=
"// Frame Controls xyxzy(IDW_*)" file=
"${help.context}" append=
"true"/>
290 <exec program=
"makehm"
291 commandline=
"/h /a afxhh.h IDW_,HIDW_,0x50000 ${headerfile}"
292 output=
"${help.context}"
297 <!-- Copy help context to target location -->
298 <copy file=
"${help.context}" tofile=
"${doc.target.work}/context.h" overwrite=
"true"/>