1 <?xml version=
"1.0" encoding=
"utf-8"?>
4 Name: include/testdrive.xml
5 Purpose: Declarations for the testdrive build slaves
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"
18 <xi:include href=
"defs.xml"/>
21 build - add a default <sandbox> element, the same as the previous build.
23 <xsl:template name=
"build">
24 <xsl:param name=
"content"/>
26 <defaults content=
"{$content}">
27 <xsl:apply-templates select=
"get:property('sandbox', get:preceding-builds())[last()]"/>
29 <xsl:copy-of select=
"$content"/>
34 checkout - build step for source checkout.
36 Usage: as <svn> with additional <command> element and defaults for
37 <baseURL> and <defaultBranch>
42 <checkout branch="branches/WX_2_8_BRANCH"/>
45 <xsl:template name=
"checkout">
46 <xsl:param name=
"content"/>
47 <xsl:param name=
"branch" select=
"'trunk'"/>
48 <xsl:variable name=
"nodes" select=
"exsl:node-set($content)"/>
51 <xsl:if test=
"not($nodes/svnurl)">
52 <xsl:if test=
"not($nodes/baseURL)">
53 <baseURL><SVN_URL/></baseURL>
55 <xsl:if test=
"not($nodes/defaultBranch)">
56 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
59 <xsl:if test=
"not($nodes/command)">
62 <xsl:copy-of select=
"$content"/>
67 fatch - fetch an source tarball/zip over http or ftp.
70 <fetch branch="Daily_HEAD/wxX11.tar.gz"/>
72 Fetches the URL given by <baseURL>/$branch, where the current default
73 for <baseURL> is "http://biolpc22.york.ac.uk/pub".
75 The archive is then extracted by executing <profile/> then <unarchive/>
76 on the remote machine.
78 <xsl:template name=
"fetch">
79 <xsl:param name=
"content"/>
80 <xsl:param name=
"branch">Daily_HEAD/wxWidgets.tar.gz
</xsl:param>
83 <defaults content=
"{$content}">
84 <baseURL><SNAPSHOT_URL/></baseURL>
85 <defaultBranch><xsl:value-of select=
"$branch"/></defaultBranch>
88 <xsl:copy-of select=
"$content"/>
93 steps - overrides <steps> to prepend <profile/> and <prologue/> and
94 append <epilogue/> to the <command/> of each build step.
98 The differences between <profile/> and <prologue/> are:
99 1. <profile/> is also used by <checkout> for its post checkout command.
100 2. In <profile> the current node is the <steps> element.
101 3. In <prologue> the current node is the build step inside a generated
102 nodeset. The current build is passes as a parameter.
104 <xsl:template name=
"steps">
105 <xsl:param name=
"content"/>
106 <xsl:variable name=
"profile"><profile/></xsl:variable>
107 <xsl:variable name=
"build" select=
"get:build()"/>
109 <xsl:for-each select=
"exsl:node-set($content)/*">
111 <xsl:when test=
"contains(name(), 'svn') or
112 contains(name(), 'get')">
113 <xsl:copy-of select=
"."/>
117 <xsl:copy-of select=
"@*"/>
118 <xsl:copy-of select=
"$profile"/>
119 <prologue build=
"{$build}"/>
120 <xsl:copy-of select=
"node()"/>
121 <xsl:if test=
"not(command)">
124 <epilogue build=
"{$build}"/>
133 if-del-on-fail - used in the context of a build step, copies its content
134 if the build step should cleanup on failure.
136 Usage: <if-del-on-fail>foobar</if-del-on-fail>
138 On the testdrive the working directory is deleted after a build to save
139 space. If the step has <haltOnFailure/> (which is the default or
140 <configure> and <compile> steps) then this cleanup needs to happen
141 whenever the step fails.
143 <xsl:template name=
"if-del-on-fail">
144 <xsl:param name=
"content"/>
145 <xsl:if test =
"position() = last() or
146 haltOnFailure = '' or
147 haltOnFailure = 'true' or
148 (not(haltOnFailure) and
149 (name() = 'configure' or name() = 'compile'))">
150 <xsl:copy-of select=
"$content"/>
155 Add slave locks so that each testdrive machine only runs one bulid at a
160 <xsl:template name=
"create-locks">
161 <xsl:variable name=
"rtf">
162 <xsl:apply-templates select=
"get:property('sandbox', get:all-builds())"/>
164 <xsl:variable name=
"sandboxes" select=
"exsl:node-set($rtf)/sandbox"/>
165 <xsl:for-each select=
"$sandboxes">
166 <xsl:variable name=
"text" select=
"text()"/>
167 <xsl:variable name=
"position" select=
"position()"/>
168 <xsl:if test=
"not($sandboxes[text() = $text and position() < $position])">
170 <name><xsl:value-of select=
"node()"/></name>
176 <xsl:template name=
"sandbox">
177 <xsl:param name=
"content"/>
178 <sandbox><xsl:copy-of select=
"$content"/></sandbox>
179 <lock><xsl:copy-of select=
"$content"/></lock>