|
1 <?xml version="1.0" encoding="UTF-8"?> |
|
2 <!-- |
|
3 ============================================================================ |
|
4 Name : build.xml |
|
5 Part of : Helium AntLib |
|
6 |
|
7 Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
8 All rights reserved. |
|
9 This component and the accompanying materials are made available |
|
10 under the terms of the License "Eclipse Public License v1.0" |
|
11 which accompanies this distribution, and is available |
|
12 at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
13 |
|
14 Initial Contributors: |
|
15 Nokia Corporation - initial contribution. |
|
16 |
|
17 Contributors: |
|
18 |
|
19 Description: |
|
20 |
|
21 ============================================================================ |
|
22 --> |
|
23 <project name="demo" xmlns:au="antlib:org.apache.ant.antunit" xmlns:hlm="http://www.nokia.com/helium"> |
|
24 <description>Helium Antlib SCM demo.</description> |
|
25 |
|
26 <taskdef name="scm" classname="com.nokia.helium.scm.ant.taskdefs.ScmTask" uri="http://www.nokia.com/helium" /> |
|
27 <typedef name="latestTag" classname="com.nokia.helium.scm.ant.types.LatestTag" uri="http://www.nokia.com/helium" /> |
|
28 <typedef name="tagSet" classname="com.nokia.helium.scm.ant.types.TagSet" uri="http://www.nokia.com/helium" /> |
|
29 |
|
30 <target name="setup"> |
|
31 <delete dir="./temp" failonerror="false" /> |
|
32 <unzip src="hg_test1.zip" dest="./temp" /> |
|
33 <unzip src="hg_test2.zip" dest="./temp" /> |
|
34 <unzip src="hg_test3.zip" dest="./temp" /> |
|
35 <property name="test1.dir" location="./temp/test1" /> |
|
36 <property name="test2.dir" location="./temp/test2" /> |
|
37 <property name="test3.dir" location="./temp/test3" /> |
|
38 </target> |
|
39 |
|
40 <target name="get-status"> |
|
41 <hlm:scm verbose="true" scmUrl="scm:hg:${ant.file.demo}/../temp/test1"> |
|
42 <hlm:status> |
|
43 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
44 <include name="**" /> |
|
45 <exclude name="**/.hg/**" /> |
|
46 </fileset> |
|
47 </hlm:status> |
|
48 </hlm:scm> |
|
49 </target> |
|
50 |
|
51 <target name="demo-status"> |
|
52 <antcall target="get-status" /> |
|
53 <echo file="${ant.file.demo}/../temp/test1/not_in_repo.txt">Not in repo</echo> |
|
54 <antcall target="get-status" /> |
|
55 <hlm:scm verbose="true" scmUrl="scm:hg:${ant.file.demo}/../temp/test1"> |
|
56 <hlm:add> |
|
57 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
58 <include name="**" /> |
|
59 <exclude name="**/.hg/**" /> |
|
60 </fileset> |
|
61 </hlm:add> |
|
62 </hlm:scm> |
|
63 <antcall target="get-status" /> |
|
64 </target> |
|
65 |
|
66 <target name="demo-diff" depends="setup"> |
|
67 <echo file="${ant.file.demo}/../temp/test1/not_in_repo.txt">Not in repo</echo> |
|
68 <hlm:scm verbose="true" scmUrl="scm:hg:${ant.file.demo}/../temp/test1"> |
|
69 <hlm:add> |
|
70 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
71 <include name="**" /> |
|
72 <exclude name="**/.hg/**" /> |
|
73 </fileset> |
|
74 </hlm:add> |
|
75 </hlm:scm> |
|
76 |
|
77 <hlm:scm verbose="true" scmUrl="scm:hg:${ant.file.demo}/../temp/test1"> |
|
78 <hlm:diff> |
|
79 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
80 <include name="**" /> |
|
81 <exclude name="**/.hg/**" /> |
|
82 </fileset> |
|
83 </hlm:diff> |
|
84 </hlm:scm> |
|
85 </target> |
|
86 |
|
87 |
|
88 <!--DEMO "checkout" --> |
|
89 <target name="demo-checkout" depends="setup"> |
|
90 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
91 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test3"> |
|
92 <!--Clone--> |
|
93 <hlm:checkout baseDir="${temp.dir}/clones/clone" /> |
|
94 |
|
95 <!--Clone to revision '0'--> |
|
96 <hlm:checkout baseDir="${temp.dir}/clones/clone_rev_0"> |
|
97 <hlm:revision name="0" /> |
|
98 </hlm:checkout> |
|
99 |
|
100 <!--Clone to revision '1'--> |
|
101 <hlm:checkout baseDir="${temp.dir}/clones/clone_rev_1"> |
|
102 <hlm:revision name="1" /> |
|
103 </hlm:checkout> |
|
104 </hlm:scm> |
|
105 </target> |
|
106 |
|
107 <target name="demo-all" depends="setup"> |
|
108 <mkdir dir="${ant.file.demo}/../temp/cloned" /> |
|
109 <echo file="${ant.file.demo}/../temp/test1/not_in_repo.txt">Not in repo</echo> |
|
110 <echo file="${ant.file.demo}/../temp/test1/not_in_repo2.txt">Not in repo2</echo> |
|
111 |
|
112 <hlm:scm verbose="false" scmUrl="scm:hg:${test1.dir}"> |
|
113 <hlm:checkout baseDir="${ant.file.demo}/../temp/cloned" /> |
|
114 <hlm:add> |
|
115 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
116 <include name="not_in_repo.txt" /> |
|
117 </fileset> |
|
118 </hlm:add> |
|
119 <hlm:checkin message="Adding not_in_repo.txt..."> |
|
120 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
121 <include name="not_in_repo.txt" /> |
|
122 </fileset> |
|
123 </hlm:checkin> |
|
124 <hlm:tag baseDir="${ant.file.demo}/../temp/test1" name="1.0.0" /> |
|
125 <hlm:add> |
|
126 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
127 <include name="not_in_repo2.txt" /> |
|
128 </fileset> |
|
129 </hlm:add> |
|
130 <hlm:checkin message="Adding not_in_repo2.txt..."> |
|
131 <fileset dir="${ant.file.demo}/../temp/test1"> |
|
132 <include name="not_in_repo2.txt" /> |
|
133 </fileset> |
|
134 </hlm:checkin> |
|
135 <hlm:tag baseDir="${ant.file.demo}/../temp/test1" name="1.0.1" /> |
|
136 </hlm:scm> |
|
137 |
|
138 |
|
139 <hlm:scm verbose="false" scmUrl="scm:hg:${ant.file.demo}/../temp/cloned"> |
|
140 <hlm:pull baseDir="${ant.file.demo}/../temp/cloned" /> |
|
141 <hlm:update baseDir="${ant.file.demo}/../temp/cloned" /> |
|
142 <hlm:tags baseDir="${ant.file.demo}/../temp/cloned" reference="cloned.tags" /> |
|
143 <hlm:update baseDir="${ant.file.demo}/../temp/cloned"> |
|
144 <hlm:latestTag pattern="1.0.*"> |
|
145 <hlm:tagSet refid="cloned.tags" /> |
|
146 </hlm:latestTag> |
|
147 </hlm:update> |
|
148 </hlm:scm> |
|
149 |
|
150 <hlm:scm verbose="true" scmUrl="scm:hg:${ant.file.demo}/../temp/cloned"> |
|
151 <hlm:remove message="Nothing to remove..."> |
|
152 <fileset dir="${ant.file.demo}/../temp/cloned"> |
|
153 <include name="*.txt" /> |
|
154 </fileset> |
|
155 </hlm:remove> |
|
156 </hlm:scm> |
|
157 |
|
158 </target> |
|
159 |
|
160 <target name="demo-export" depends="setup"> |
|
161 <mkdir dir="${ant.file.demo}/../temp/export" /> |
|
162 |
|
163 <hlm:scm verbose="false" scmUrl="scm:hg:${ant.file.demo}/../temp/test2"> |
|
164 <hlm:export baseDir="${ant.file.demo}/../temp/test2" destPath="${ant.file.demo}/../temp/export"> |
|
165 <tag name="2" /> |
|
166 </hlm:export> |
|
167 </hlm:scm> |
|
168 </target> |
|
169 |
|
170 <!--DEMO "Tagging" --> |
|
171 <target name="demo-tag" depends="setup"> |
|
172 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
173 |
|
174 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
175 <hlm:checkout baseDir="${temp.dir}/tag" /> |
|
176 </hlm:scm> |
|
177 |
|
178 <echo file="${temp.dir}/tag/newfile.txt">newly added</echo> |
|
179 |
|
180 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/tag"> |
|
181 <hlm:add> |
|
182 <fileset dir="${temp.dir}/tag"> |
|
183 <include name="*.txt" /> |
|
184 </fileset> |
|
185 </hlm:add> |
|
186 <hlm:checkin message="Adding files ....."> |
|
187 <fileset dir="${temp.dir}/tag"> |
|
188 <include name="*.txt" /> |
|
189 </fileset> |
|
190 </hlm:checkin> |
|
191 |
|
192 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.1" level="local" /> |
|
193 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.2" /> |
|
194 |
|
195 </hlm:scm> |
|
196 </target> |
|
197 |
|
198 <!--DEMO "Branch" --> |
|
199 <target name="demo-branch" depends="setup"> |
|
200 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
201 |
|
202 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
203 <hlm:checkout baseDir="${temp.dir}/branch" revision="0" /> |
|
204 </hlm:scm> |
|
205 |
|
206 <echo file="${temp.dir}/branch/newfile.txt">newly added</echo> |
|
207 <echo file="${temp.dir}/branch/newfile2.txt">newly added</echo> |
|
208 <echo file="${temp.dir}/branch/newfile3.txt">newly added</echo> |
|
209 |
|
210 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/branch"> |
|
211 <hlm:branch baseDir="${temp.dir}/branch" name="test_0.1" /> |
|
212 <hlm:add> |
|
213 <fileset dir="${temp.dir}/branch"> |
|
214 <include name="*.txt" /> |
|
215 </fileset> |
|
216 </hlm:add> |
|
217 <hlm:checkin message="Adding files ....."> |
|
218 <fileset dir="${temp.dir}/branch"> |
|
219 <include name="*.txt" /> |
|
220 </fileset> |
|
221 </hlm:checkin> |
|
222 </hlm:scm> |
|
223 </target> |
|
224 |
|
225 <!--DEMO "update" --> |
|
226 <target name="demo-update" depends="setup"> |
|
227 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
228 |
|
229 <!--Create the first revision --> |
|
230 <echo file="${temp.dir}/test1/not_in_repo1.txt">Not in repo1</echo> |
|
231 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
232 <hlm:add> |
|
233 <fileset dir="${temp.dir}/test1"> |
|
234 <include name="not_in_repo1.txt" /> |
|
235 <exclude name="**/.hg/**" /> |
|
236 </fileset> |
|
237 </hlm:add> |
|
238 </hlm:scm> |
|
239 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
240 <hlm:checkin message="Adding not_in_repo1.txt..."> |
|
241 <fileset dir="${temp.dir}/test1"> |
|
242 <include name="not_in_repo1.txt" /> |
|
243 </fileset> |
|
244 </hlm:checkin> |
|
245 </hlm:scm> |
|
246 |
|
247 <!--Create the second revision --> |
|
248 <echo file="${temp.dir}/test1/not_in_repo2.txt">Not in repo2</echo> |
|
249 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
250 <hlm:add> |
|
251 <fileset dir="${temp.dir}/test1"> |
|
252 <include name="not_in_repo2.txt" /> |
|
253 <exclude name="**/.hg/**" /> |
|
254 </fileset> |
|
255 </hlm:add> |
|
256 </hlm:scm> |
|
257 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
258 <hlm:checkin message="Adding not_in_repo2.txt..."> |
|
259 <fileset dir="${temp.dir}/test1"> |
|
260 <include name="not_in_repo2.txt" /> |
|
261 </fileset> |
|
262 </hlm:checkin> |
|
263 </hlm:scm> |
|
264 |
|
265 <!-- Update to first revision --> |
|
266 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
267 <hlm:update baseDir="${temp.dir}/test1"> |
|
268 <hlm:revision name="0" /> |
|
269 </hlm:update> |
|
270 </hlm:scm> |
|
271 |
|
272 </target> |
|
273 |
|
274 <!--DEMO "Change Log" --> |
|
275 <target name="demo-changelog" depends="setup"> |
|
276 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
277 |
|
278 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
279 <hlm:checkout baseDir="${temp.dir}/changelog" /> |
|
280 <hlm:tag baseDir="${temp.dir}/changelog" name="tag_0.2" /> |
|
281 <hlm:branch baseDir="${temp.dir}/changelog" name="test_0.1" /> |
|
282 </hlm:scm> |
|
283 |
|
284 <echo file="${temp.dir}/changelog/newfile.txt">newly added</echo> |
|
285 <echo file="${temp.dir}/changelog/newfile2.txt">newly added</echo> |
|
286 <echo file="${temp.dir}/changelog/newfile3.txt">newly added</echo> |
|
287 |
|
288 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/changelog"> |
|
289 <hlm:add> |
|
290 <fileset dir="${temp.dir}/changelog"> |
|
291 <include name="*.txt" /> |
|
292 </fileset> |
|
293 </hlm:add> |
|
294 <hlm:checkin message="Adding files ....."> |
|
295 <fileset dir="${temp.dir}/changelog"> |
|
296 <include name="*.txt" /> |
|
297 </fileset> |
|
298 </hlm:checkin> |
|
299 <hlm:changelog basedir="${temp.dir}/changelog" startVersion="0" /> |
|
300 </hlm:scm> |
|
301 |
|
302 <echo file="${temp.dir}/changelog/newfile4.txt">newly added</echo> |
|
303 <echo file="${temp.dir}/changelog/newfile5.txt">newly added</echo> |
|
304 <echo file="${temp.dir}/changelog/newfile6.txt">newly added</echo> |
|
305 |
|
306 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/changelog"> |
|
307 <hlm:add> |
|
308 <fileset dir="${temp.dir}/changelog"> |
|
309 <include name="*.txt" /> |
|
310 </fileset> |
|
311 </hlm:add> |
|
312 <hlm:checkin message="Adding files ....."> |
|
313 <fileset dir="${temp.dir}/changelog"> |
|
314 <include name="*.txt" /> |
|
315 </fileset> |
|
316 </hlm:checkin> |
|
317 <!--hlm:changelog baseDir="${temp.dir}/changelog" numDays='1' /--> |
|
318 <!--hlm:changelog baseDir="${temp.dir}/changelog" startDate="20090317 18:49:31" endDate="20090323 24:49:31" datePattern="yyyyMMdd HH:mm:ss" /--> |
|
319 <!--hlm:changelog basedir="${temp.dir}/changelog" startVersion="0" /--> |
|
320 <hlm:changelog basedir="${temp.dir}/changelog" startVersion="1" endVersion="2"/> |
|
321 <!--hlm:changelog basedir="${temp.dir}/changelog" startVersion="1" endVersion="2" logOutput="xml" /--> |
|
322 </hlm:scm> |
|
323 </target> |
|
324 |
|
325 <!--DEMO "info" --> |
|
326 <target name="demo-info" depends="setup"> |
|
327 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
328 |
|
329 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
330 <hlm:checkout baseDir="${temp.dir}/info" /> |
|
331 </hlm:scm> |
|
332 |
|
333 <echo file="${temp.dir}/info/newfile.txt">newly added</echo> |
|
334 <echo file="${temp.dir}/info/newfile2.txt">newly added</echo> |
|
335 <echo file="${temp.dir}/info/newfile3.txt">newly added</echo> |
|
336 |
|
337 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/info"> |
|
338 <hlm:add> |
|
339 <fileset dir="${temp.dir}/info"> |
|
340 <include name="*.txt" /> |
|
341 </fileset> |
|
342 </hlm:add> |
|
343 <hlm:checkin message="Adding files ....."> |
|
344 <fileset dir="${temp.dir}/info"> |
|
345 <include name="*.txt" /> |
|
346 </fileset> |
|
347 </hlm:checkin> |
|
348 <hlm:info baseDir="${ant.file.demo}/../temp/info"/> |
|
349 </hlm:scm> |
|
350 </target> |
|
351 |
|
352 <!--DEMO "failonerror-false" --> |
|
353 <target name="demo-failonerror-false" depends="setup"> |
|
354 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
355 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
356 <hlm:checkout baseDir="${temp.dir}/tag" /> |
|
357 </hlm:scm> |
|
358 <echo file="${temp.dir}/tag/newfile.txt">newly added</echo> |
|
359 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/tag" failonerror="false"> |
|
360 <hlm:add> |
|
361 <fileset dir="${temp.dir}/tag"> |
|
362 <include name="*.txt" /> |
|
363 </fileset> |
|
364 </hlm:add> |
|
365 <hlm:checkin message="Adding files ....."> |
|
366 <fileset dir="${temp.dir}/tag"> |
|
367 <include name="*.txt" /> |
|
368 </fileset> |
|
369 </hlm:checkin> |
|
370 <!-- Build should continue as failonerror="false" --> |
|
371 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.2"/> |
|
372 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.2"/> |
|
373 </hlm:scm> |
|
374 <echo> Build continue.... </echo> |
|
375 </target> |
|
376 |
|
377 <!--DEMO "failonerror-true" --> |
|
378 <target name="demo-failonerror-true" depends="setup"> |
|
379 <property name="temp.dir" location="${ant.file.demo}/../temp" /> |
|
380 <hlm:scm verbose="true" scmUrl="scm:hg:${temp.dir}/test1"> |
|
381 <hlm:checkout baseDir="${temp.dir}/tag" /> |
|
382 </hlm:scm> |
|
383 <echo file="${temp.dir}/tag/newfile.txt">newly added</echo> |
|
384 <hlm:scm verbose="false" scmUrl="scm:hg:${temp.dir}/tag" failonerror="true"> |
|
385 <hlm:add> |
|
386 <fileset dir="${temp.dir}/tag"> |
|
387 <include name="*.txt" /> |
|
388 </fileset> |
|
389 </hlm:add> |
|
390 <hlm:checkin message="Adding files ....."> |
|
391 <fileset dir="${temp.dir}/tag"> |
|
392 <include name="*.txt" /> |
|
393 </fileset> |
|
394 </hlm:checkin> |
|
395 <!-- Build should fail as failonerror="true" --> |
|
396 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.3"/> |
|
397 <hlm:tag baseDir="${temp.dir}/tag" name="tag_0.3"/> |
|
398 </hlm:scm> |
|
399 </target> |
|
400 |
|
401 </project> |