1 <?xml version=
"1.0" encoding=
"utf-8"?>
5 Purpose: Common declarations for buildbot
8 Copyright: (c) 2007 Mike Wetherell
9 Licence: wxWidgets licence
12 <bot xmlns:
xi=
"http://www.w3.org/2001/XInclude"
13 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
14 xmlns:
exsl=
"http://exslt.org/common"
20 <xsl:template name=
"SVN_URL">http://svn.wxwidgets.org/svn/wx/wxWidgets/
</xsl:template>
21 <xsl:template name=
"STABLE_BRANCH">branches/WX_2_8_BRANCH
</xsl:template>
22 <xsl:variable name=
"STABLE_BRANCH"><STABLE_BRANCH/></xsl:variable>
25 checkout - build step for source checkout.
27 Usage: as <svn> with defaults for <baseURL> and <defaultBranch>
32 <checkout branch="branches/WX_2_8_BRANCH"/>
35 <xsl:template name=
"checkout">
36 <xsl:param name=
"content"/>
37 <xsl:param name=
"branch" select=
"'trunk'"/>
38 <xsl:variable name=
"nodes" select=
"exsl:node-set($content)"/>
40 <xsl:if test=
"not($nodes/svnurl)">
41 <xsl:if test=
"not($nodes/baseURL)">
42 <baseURL><SVN_URL/></baseURL>
44 <xsl:if test=
"not($nodes/defaultBranch)">
45 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
48 <xsl:copy-of select=
"$content"/>
53 configure - add the options attribute to <configure>
55 Usage: <configure options="-with-foobar"/>
57 <xsl:template name=
"configure">
58 <xsl:param name=
"content"/>
59 <xsl:param name=
"options"/>
61 <copy-with-defaults content=
"{$content}">
62 <command>./configure
<xsl:value-of select=
"$options"/></command>
68 make - specify the make command.
70 Usage: <make>nmake -f makefile.vc SHARED=1</make>
72 Used as a child of <build> to specify the make command used by the
73 <compile> elements below, if omitted 'make' is used.
75 <xsl:template name=
"make"/>
78 compile - modifiy <compile> to default to the command given by <make>
82 The <make> element of <build> spcecifies the make command used by all
83 compile build steps in the build. If <make> is not given 'make' is used.
85 The command for a particular compile build step can be further overridden
86 using its <command> element:
88 <command>myscript</command>
91 <xsl:template name=
"compile">
92 <xsl:param name=
"content"/>
94 <copy-with-defaults content=
"{$content}">
95 <command><get name=
"make" default=
"make"/></command>
101 Compile build steps for the usual subdirectories.
112 By default the compile command produced is:
114 As above, the 'make' part can be overridden using the <make> element or
115 the whole command line can be replaced using <command>.
117 <compile-msw> and <compile-tests> halt the build on failure, the others
118 continue with the next step (can be overridden by <haltOnFailure>).
120 <xsl:template name=
"compile-msw">
121 <xsl:param name=
"content"/>
122 <compile-subdir dir=
"build\msw" halt=
"true">
123 <xsl:copy-of select=
"$content"/>
127 <xsl:template name=
"compile-samples">
128 <xsl:param name=
"content"/>
129 <compile-subdir dir=
"samples">
130 <xsl:copy-of select=
"$content"/>
134 <xsl:template name=
"compile-utils">
135 <xsl:param name=
"content"/>
136 <compile-subdir dir=
"utils">
137 <xsl:copy-of select=
"$content"/>
141 <xsl:template name=
"compile-contrib">
142 <xsl:param name=
"content"/>
143 <compile-subdir dir=
"contrib">
144 <xsl:copy-of select=
"$content"/>
148 <xsl:template name=
"compile-tests">
149 <xsl:param name=
"content"/>
150 <compile-subdir dir=
"tests" halt=
"true">
151 <xsl:copy-of select=
"$content"/>
156 compile-subdir - build step to compile a subdirectory.
158 Usage: as <compile> plus the following attributes,
159 <compile-subdir dir="foobar" [ halt="true" ]/>
161 Compiles the named subdirectory 'foobar'. Continues with the next build
162 step on failure, unless the optional attibute 'halt="true"' is given.
163 The make command used is as described for the compile steps above.
165 <xsl:template name=
"compile-subdir">
166 <xsl:param name=
"content"/>
167 <xsl:param name=
"dir"/>
168 <xsl:param name=
"halt" select=
"'false'"/>
170 <defaults content=
"{$content}">
172 compile
<xsl:value-of select=
"$dir"/>
175 compiling
<xsl:value-of select=
"$dir"/>
178 compile
<xsl:value-of select=
"$dir"/>
181 <xsl:value-of select=
"$halt"/>
185 <copy-with-defaults content=
"{$content}">
186 <command>cd
<xsl:value-of select=
"$dir"/> && <get name=
"make" default=
"make"/></command>
187 </copy-with-defaults>
192 run-tests - build step to run the test suites.
196 For unix builds typically just:
198 or for Windows builds, e.g.:
200 <command>PATH=..\lib\vc_lib;%PATH%</command>
201 <command>cd tests && vc_msw\test</command>
204 <xsl:template name=
"run-tests">
205 <xsl:param name=
"content"/>
207 <defaults content=
"{$content}">
208 <description>running tests
</description>
209 <descriptionDone>run tests
</descriptionDone>
212 <copy-with-defaults content=
"{$content}">
213 <command><xi:include href=
"run-tests.sh" parse=
"text"/></command>
214 </copy-with-defaults>
219 defaults - supply default content for an element.
221 Usage: <defaults content="{$content}">
226 Copies those child elements that do not already exist in $content.
228 <xsl:template name=
"defaults">
229 <xsl:param name=
"defaults"/>
230 <xsl:param name=
"content"/>
232 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
233 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
235 <xsl:for-each select=
"$def-nodes/*">
236 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
237 <xsl:copy-of select=
"."/>
243 copy-with-defaults - copy elements supplying defaults for any that are
246 Usage: <copy-with-defaults content="{$content}">
249 </copy-with-defaults>
251 Copies $content plus any child elements that do not exist in $content,
252 substituting empty elements in $content with any child elements of the
255 <xsl:template name=
"copy-with-defaults">
256 <xsl:param name=
"defaults"/>
257 <xsl:param name=
"content"/>
259 <xsl:variable name=
"def-nodes" select=
"exsl:node-set($defaults)"/>
260 <xsl:variable name=
"cont-nodes" select=
"exsl:node-set($content)"/>
262 <xsl:for-each select=
"$def-nodes/*">
263 <xsl:if test=
"not($cont-nodes/*[name() = name(current())])">
264 <xsl:copy-of select=
"."/>
268 <xsl:for-each select=
"$cont-nodes/*">
270 <xsl:when test=
"not(node())">
271 <xsl:copy-of select=
"$def-nodes/*[name() = name(current())]"/>
274 <xsl:copy-of select=
"."/>
281 get - gets the value of a named element inside a <build>.
283 Usage: <get name="foobar" [ default="value" ]/>
285 Used inside a <build> evaluates to the value of the build's <foobar>
286 element, or to the value of the optional 'default' attribute if there is
289 <xsl:template name=
"get">
290 <xsl:param name=
"content"/>
291 <xsl:param name=
"name"/>
292 <xsl:param name=
"default"/>
295 <xsl:when test=
"ancestor-or-self::build/*[name() = $name]">
296 <xsl:apply-templates select=
"ancestor-or-self::build/*[name() = $name]/node()"/>
299 <xsl:value-of select=
"$default"/>
306 strip - strips leading and trailing whitespace
312 Strips leading and trailing whitespace if the content is text only,
313 otherwise copies the content unchanged.
315 <xsl:template name=
"strip">
316 <xsl:param name=
"content"/>
317 <xsl:variable name=
"len" select=
"string-length($content)"/>
318 <xsl:variable name=
"norm" select=
"normalize-space($content)"/>
319 <xsl:variable name=
"normlen" select=
"string-length($norm)"/>
321 <xsl:when test=
"exsl:node-set($content)/*">
322 <xsl:copy-of select=
"$content"/>
324 <xsl:when test=
"substring($content, 1, 1) != substring($norm, 1, 1)">
325 <xsl:call-template name=
"strip">
326 <xsl:with-param name=
"content" select=
"substring($content, 2)"/>
329 <xsl:when test=
"substring($content, $len, 1) != substring($norm, $normlen, 1)">
330 <xsl:call-template name=
"strip">
331 <xsl:with-param name=
"content" select=
"substring($content, 1, $len - 1)"/>
335 <xsl:value-of select=
"$content"/>