author | Shabe Razvi <shaber@symbian.org> |
Mon, 14 Jun 2010 12:31:32 +0100 | |
changeset 1098 | 9485f8e9a74c |
parent 1046 | 871bdf0d7610 |
child 1083 | a91d8608229c |
permissions | -rw-r--r-- |
41
f137ddbb714d
Added tagging of source code used in the build
dariosestito@L063522.prod.ad.symbian.intra
parents:
diff
changeset
|
1 |
<?xml version="1.0"?> |
f137ddbb714d
Added tagging of source code used in the build
dariosestito@L063522.prod.ad.symbian.intra
parents:
diff
changeset
|
2 |
<project name="SF-TAG-HG-CODE" default="all" xmlns:hlm="http://www.nokia.com/helium"> |
f137ddbb714d
Added tagging of source code used in the build
dariosestito@L063522.prod.ad.symbian.intra
parents:
diff
changeset
|
3 |
|
1046
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
4 |
<#assign dollar = "$"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
5 |
|
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
6 |
<#assign target_depends = "" /> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
7 |
<#assign count = 0 /> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
8 |
|
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
9 |
<#list data as pkg_detail> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
10 |
<target name="sf-tag-hg-code-${count}"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
11 |
<echo message="Cloning TAGS branch from ${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
12 |
<mkdir dir="${ant['build.drive']}/tagging${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
13 |
<exec executable="hg" dir="${ant['build.drive']}/" failonerror="false" resultproperty="clone.from.dst.${count}.exitcode" errorproperty="clone.from.dst.${count}.stderr"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
14 |
<arg value="--quiet"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
15 |
<arg value="clone"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
16 |
<arg value="--rev"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
17 |
<arg value="TAGS"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
18 |
<arg value="${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
19 |
<arg value="tagging${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
20 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
21 |
<if> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
22 |
<not> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
23 |
<equals arg1="${dollar}{clone.from.dst.${count}.exitcode}" arg2="0"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
24 |
</not> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
25 |
<then> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
26 |
<!-- TAGS branch not in local source - probably caused by package being new and not having a TAGS branch yet --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
27 |
<echo message="Clone failed because '${dollar}{clone.from.dst.${count}.stderr}'"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
28 |
<!-- Clone the null revision instead --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
29 |
<exec executable="hg" dir="${ant['build.drive']}" failonerror="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
30 |
<arg value="--quiet"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
31 |
<arg value="clone"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
32 |
<arg value="--rev"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
33 |
<arg value="null"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
34 |
<arg value="${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
35 |
<arg value="tagging${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
36 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
37 |
<!-- Create the branch --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
38 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
39 |
<arg value="branch"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
40 |
<arg value="TAGS"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
41 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
42 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
43 |
<arg value="--quiet"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
44 |
<arg value="commit"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
45 |
<arg value="--message"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
46 |
<arg value="Created TAGS branch"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
47 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
48 |
<!-- Push it back to the source repo --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
49 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
50 |
<arg value="--quiet"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
51 |
<arg value="push"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
52 |
<arg value="--force"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
53 |
<arg value="--rev"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
54 |
<arg value="."/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
55 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
56 |
</then> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
57 |
</if> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
58 |
<!-- Find out what we're synced to in the main source repo --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
59 |
<exec executable="hg" dir="${ant['build.drive']}" outputproperty="hash12.${count}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
60 |
<arg value="id"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
61 |
<arg value="-i"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
62 |
<arg value="${pkg_detail.dst}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
63 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
64 |
<!-- Get the full hash id --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
65 |
<exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="hash40.${count}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
66 |
<arg value="log"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
67 |
<arg value="--rev"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
68 |
<arg value="${dollar}{hash12.${count}}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
69 |
<arg value="--template"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
70 |
<arg value="{node}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
71 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
72 |
<!-- Manually add the tag to the tags file --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
73 |
<echo message="${dollar}{hash40.${count}} ${ant['sf.tagafterbuild.tag']}${dollar}{line.separator}" file="${ant['build.drive']}/tagging${pkg_detail.dst}/.hgtags" append="true"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
74 |
<!-- Make sure the file is added (in case this is the first tagging for this package) --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
75 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}" output="nul:"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
76 |
<arg value="add"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
77 |
<arg value=".hgtags"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
78 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
79 |
<!-- Manually commit it --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
80 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
81 |
<arg value="--quiet"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
82 |
<arg value="commit"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
83 |
<arg value="--message"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
84 |
<arg value="Added tag ${ant['sf.tagafterbuild.tag']} for changeset ${dollar}{hash12.${count}}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
85 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
86 |
<!-- Work out the URL of the web *MCL* --> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
87 |
<propertyregex property="mcl.${count}" input="${pkg_detail.source}" regexp="(developer.symbian.org)/(oss|sfl)/FCL/(sf|sftools)" casesensitive="false" replace="\1/\2/MCL/\3" defaultValue="${pkg_detail.source}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
88 |
<echo message="Outgoing changes for ${dollar}{mcl.${count}}:"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
89 |
<exec executable="hg" dir="${ant['build.drive']}/tagging${pkg_detail.dst}" logError="true"> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
90 |
<arg value="out"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
91 |
<arg value="--force"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
92 |
<arg value="--rev"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
93 |
<arg value="TAGS"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
94 |
<arg value="${dollar}{mcl.${count}}"/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
95 |
</exec> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
96 |
</target> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
97 |
|
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
98 |
<#if (count > 0) > |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
99 |
<#assign target_depends ="${target_depends}" + ", "/> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
100 |
</#if> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
101 |
<#assign target_depends = "${target_depends}" + "sf-tag-hg-code-${count}" /> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
102 |
|
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
103 |
<#assign count = count + 1 /> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
104 |
</#list> |
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
105 |
|
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
106 |
<target name="all" depends="${target_depends}"/> |
41
f137ddbb714d
Added tagging of source code used in the build
dariosestito@L063522.prod.ad.symbian.intra
parents:
diff
changeset
|
107 |
|
1046
871bdf0d7610
Updated template for tagging source code so it uses the TAGS branch.
Simon Howkins <simonh@symbian.org>
parents:
55
diff
changeset
|
108 |
</project> |