author | Bob Rosenberg <bob.rosenberg@nokia.com> |
Mon, 18 Oct 2010 10:23:52 +0100 | |
changeset 659 | 7afa5fba0903 |
parent 645 | b8d81fa19e7d |
permissions | -rw-r--r-- |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
2 |
<!-- |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
3 |
============================================================================ |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
4 |
Name : bom.ant.xml |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
5 |
Part of : Helium |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
6 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
7 |
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
8 |
All rights reserved. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
9 |
This component and the accompanying materials are made available |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
10 |
under the terms of the License "Eclipse Public License v1.0" |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
11 |
which accompanies this distribution, and is available |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
12 |
at the URL "http://www.eclipse.org/legal/epl-v10.html". |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
13 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
14 |
Initial Contributors: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
15 |
Nokia Corporation - initial contribution. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
16 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
17 |
Contributors: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
18 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
19 |
Description: |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
20 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
21 |
============================================================================ |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
22 |
--> |
217 | 23 |
<!--* @package preparation --> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
24 |
<project name="preparation.bom" xmlns:hlm="http://www.nokia.com/helium"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
25 |
<description> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
26 |
Creates a Bill-Of-Materials record based on the Synergy inputs. |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
27 |
</description> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
28 |
|
217 | 29 |
<!-- Your synergy work area directory (Set as the parent of the helium dir by default). |
30 |
@type string |
|
31 |
--> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
32 |
<property name="create.bom.workarea.root" value="."/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
33 |
|
628 | 34 |
<!--* @property bom.release.regex |
35 |
This property (if set) defines the regular expression BOM will use to extract data from |
|
36 |
a basline release. The regular expression must define 4 fields: TYPE, YEAR, WEEK, REVISION |
|
37 |
Example: |
|
38 |
(?<TYPE>.*)_(?P<YEAR>\d{4})(?P<WEEK>\d{2})_(?<REVISION>.*) |
|
39 |
||
40 |
@type string |
|
41 |
@editable allowed |
|
42 |
@scope public |
|
43 |
--> |
|
44 |
||
179 | 45 |
<!-- The target create-bom creates a Bill-Of-Material based on the SCM project |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
46 |
The target can be run in the project's root directory or the directory can be given by |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
47 |
setting the property create.bom.workarea.root. The IDO builds are expected to set it to their |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
48 |
projects work area directory. --> |
628 | 49 |
<target name="create-bom"> |
50 |
<runtarget target="get-ccm-password"/> |
|
51 |
<runtarget target="old-bom-log"/> |
|
52 |
<runtarget target="prep-prepare-input" /> |
|
53 |
<runtarget target="ccm-prepare-input"/> |
|
179 | 54 |
<hlm:startSpecificLogMacro name="${prep.log.dir}/${build.id}_bom.log" regexp="${ccm.user.password}" phase="prep"/> |
55 |
<hlm:python> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
56 |
import os |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
57 |
import build.model |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
58 |
import configuration |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
59 |
import nokia.nokiaccm |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
60 |
import ccm.extra |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
61 |
import ant |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
62 |
import sys |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
63 |
import traceback |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
64 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
65 |
session = None |
645 | 66 |
|
67 |
runccm = ant.get_property(r'${ccm.enabled}') |
|
68 |
database = ant.get_property(r'${ccm.database}') |
|
69 |
username = ant.get_property(r'${ccm.user.login}') |
|
70 |
password = ant.get_property(r'${ccm.user.password}') |
|
71 |
engine = ant.get_property(r'${ccm.engine.host}') |
|
72 |
dbpath = ant.get_property(r'${ccm.database.path}') |
|
73 |
waroot = ant.get_property(r'${create.bom.workarea.root}') |
|
74 |
buildid = ant.get_property(r'${build.id}') |
|
75 |
buildlogdir = ant.get_property(r'${build.log.dir}') |
|
76 |
deliveryfile = ant.get_property(r'${prep.delivery.conf.parsed}') |
|
77 |
oldbom = ant.get_property(r'${old.bom.log}') |
|
78 |
bom = None |
|
79 |
bomfilename = r"%s/%s_bom.xml" % (buildlogdir, buildid) |
|
80 |
if deliveryfile and runccm == 'true': |
|
81 |
cache = None |
|
82 |
if ant.get_property(r'${ccm.cache.xml}') is not None: |
|
83 |
cache = str(ant.get_property(r'${ccm.cache.xml}')) |
|
84 |
provider = ccm.extra.CachedSessionProvider(opener=nokia.nokiaccm.open_session, cache=cache) |
|
85 |
||
86 |
configBuilder = configuration.NestedConfigurationBuilder(open(deliveryfile, 'r')) |
|
87 |
configSet = configBuilder.getConfiguration() |
|
88 |
for config in configSet.getConfigurations(): |
|
89 |
waroot = config['dir'] |
|
90 |
print "Found wa for project %s" % waroot |
|
91 |
||
92 |
if database != None: |
|
93 |
session = provider.get(username, password, database=database) |
|
94 |
else: |
|
95 |
session = provider.get(username, password, engine, dbpath) |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
96 |
|
645 | 97 |
ccmproject = ccm.extra.get_toplevel_project(session, waroot) |
98 |
||
99 |
config_data = {'delivery': deliveryfile, 'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'ccm.database': database, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml", 'release_regexp': ant.get_property(r'${bom.release.regex}') } |
|
100 |
config = configuration.Configuration(config_data) |
|
101 |
||
102 |
# let's only support the new spec model! |
|
103 |
bom = build.model.SynergyBOM(config, ccmproject, username=username, password=password, provider=provider) |
|
104 |
||
105 |
xml_writer = build.model.BOMXMLWriter(bom) |
|
106 |
xml_writer.write(bomfilename) |
|
107 |
if not bom and os.path.exists(bomfilename): |
|
108 |
config_data = {'prep.xml': ant.get_property(r'${prep.config.file.parsed}'), 'build.id': buildid, 'symbian_rel_week': ant.get_property(r'${symbian.version.week}'), 'symbian_rel_ver': ant.get_property(r'${symbian.version}'), 'symbian_rel_year': ant.get_property(r'${symbian.version.year}'), 's60_version': ant.get_property(r'${s60.version}'), 's60_release': ant.get_property(r'${s60.release}'), 'currentRelease.xml': ant.get_property(r'${build.drive}') + "/currentRelease.xml"} |
|
109 |
config = configuration.Configuration(config_data) |
|
110 |
bom = build.model.SimpleBOM(config, bomfilename) |
|
111 |
if bom and os.path.exists(oldbom): |
|
112 |
xml_delta_writer = build.model.BOMDeltaXMLWriter(bom, oldbom) |
|
113 |
xml_delta_writer.write(buildlogdir + "/" + buildid + "_bom_delta.xml") |
|
114 |
delta_bom_content_validity = xml_delta_writer.validate_delta_bom_contents(buildlogdir + "/" + buildid + "_bom_delta.xml", bomfilename, oldbom) |
|
115 |
if((delta_bom_content_validity == False) and (ant.get_property(r'${hlm.enable.asserts}') is not None)): |
|
116 |
print 'Bom delta contents are not matching' |
|
117 |
raise Exception |
|
118 |
elif((delta_bom_content_validity == True) or (delta_bom_content_validity == None)): |
|
119 |
print 'Bom delta contents are matching.' |
|
120 |
elif(delta_bom_content_validity == False): |
|
121 |
print 'Bom delta contents are not matching.' |
|
122 |
else: |
|
123 |
print 'Old BOM log cannot be found ' + oldbom + ', skipping BOM delta creation.' |
|
124 |
if runccm == 'true': |
|
125 |
bom.close() |
|
126 |
if session: |
|
127 |
session.close() |
|
179 | 128 |
</hlm:python> |
129 |
<if> |
|
130 |
<available file="${build.log.dir}/${build.id}_bom.xml"/> |
|
131 |
<then> |
|
132 |
<echo>${build.log.dir}</echo> |
|
133 |
<xmltask source="${build.log.dir}/${build.id}_bom.xml" dest="${build.log.dir}/${build.id}_bom.xml" outputter="simple"> |
|
134 |
<replace path="//bom/build/text()" withText="${build.id}"/> |
|
135 |
</xmltask> |
|
645 | 136 |
<fmpp sourceRoot="${helium.dir}/tools/preparation/bom/templates" |
179 | 137 |
outputRoot="${prep.log.dir}" includes="bom.html.*,bom.txt.*" removeExtensions="ftl"> |
138 |
<freemarkerLinks expandProperties="yes"> |
|
139 |
macro: ${helium.dir}/tools/common/templates/macro |
|
140 |
</freemarkerLinks> |
|
141 |
<data expandProperties="yes"> |
|
142 |
doc: xml(${build.log.dir}/${build.id}_bom.xml) |
|
143 |
</data> |
|
144 |
</fmpp> |
|
145 |
||
146 |
<move file="${prep.log.dir}/bom.html" tofile="${build.log.dir}/${build.id}_bom.html"/> |
|
147 |
<move file="${prep.log.dir}/bom.txt" tofile="${prep.log.dir}/${build.id}_bom.txt"/> |
|
148 |
||
149 |
<!-- Transform bom data into the diamonds xml format: |
|
150 |
* BOM folders are flattened into tasks. |
|
151 |
* Schema version is extracted from the appropriate FMPP template. --> |
|
588 | 152 |
<mkdir dir="${temp.build.dir}" /> |
179 | 153 |
<fmpp sourcefile="${helium.dir}/tools/common/templates/diamonds/diamonds_header.ftl" |
588 | 154 |
outputfile="${temp.build.dir}/diamonds_header.xml" quiet="true"/> |
155 |
<loadfile srcfile="${temp.build.dir}/diamonds_header.xml" property="diamonds.schema.xml"> |
|
179 | 156 |
<filterchain> |
157 |
<linecontains> |
|
158 |
<contains value="schema"/> |
|
159 |
</linecontains> |
|
160 |
</filterchain> |
|
161 |
</loadfile> |
|
162 |
<mkdir dir="${diamonds.build.output.dir}" /> |
|
163 |
<xmltask source="${build.log.dir}/${build.id}_bom.xml" dest="${diamonds.build.output.dir}/create-bom.xml"> |
|
164 |
<insert path="bom/content" xml="${diamonds.schema.xml}" position="before"/> |
|
165 |
<remove path="bom/content/project/folder/name"/> |
|
166 |
<remove path="bom/build"/> |
|
167 |
<rename path="bom" to="diamonds-build"/> |
|
168 |
</xmltask> |
|
588 | 169 |
<delete file="${temp.build.dir}/diamonds_header.xml"/> |
179 | 170 |
<replace file="${diamonds.build.output.dir}/create-bom.xml" token="<folder>" value="<!-- <folder> -->"/> |
171 |
<replace file="${diamonds.build.output.dir}/create-bom.xml" token="</folder>" value="<!-- </folder> -->"/> |
|
172 |
<xmltask source="${diamonds.build.output.dir}/create-bom.xml" dest="${diamonds.build.output.dir}/create-bom.xml" |
|
173 |
outputter="simple"> |
|
174 |
<remove path="//comment()"/> |
|
175 |
</xmltask> |
|
176 |
||
177 |
<hlm:assertFileExists file="${diamonds.build.output.dir}/create-bom.xml"/> |
|
178 |
<hlm:assertFileExists file="${build.log.dir}/${build.id}_bom.html"/> |
|
179 |
<hlm:assertFileExists file="${prep.log.dir}/${build.id}_bom.txt"/> |
|
180 |
||
181 |
<runtarget target="collect-task-owner-email"/> |
|
182 |
</then> |
|
183 |
<else> |
|
184 |
<echo>WARNING: ${build.log.dir}/${build.id}_bom.xml file not found.</echo> |
|
185 |
</else> |
|
186 |
</if> |
|
187 |
||
188 |
<if> |
|
645 | 189 |
<and> |
190 |
<available file="${old.bom.log}"/> |
|
191 |
<available file="${build.log.dir}/${build.id}_bom_delta.xml"/> |
|
192 |
</and> |
|
179 | 193 |
<then> |
194 |
<hlm:assertFileExists file="${build.log.dir}/${build.id}_bom_delta.xml"/> |
|
645 | 195 |
<fmpp sourceRoot="${helium.dir}/tools/preparation/bom/templates" |
179 | 196 |
outputRoot="${prep.log.dir}" includes="bom_delta.*" removeExtensions="ftl"> |
197 |
<freemarkerLinks expandProperties="yes"> |
|
198 |
macro: ${helium.dir}/tools/common/templates/macro |
|
199 |
</freemarkerLinks> |
|
200 |
<data expandProperties="yes"> |
|
201 |
doc: xml(${build.log.dir}/${build.id}_bom_delta.xml) |
|
202 |
</data> |
|
203 |
</fmpp> |
|
204 |
||
205 |
<move file="${prep.log.dir}/bom_delta.html" tofile="${build.log.dir}/${build.id}_bom_delta.html"/> |
|
206 |
<move file="${prep.log.dir}/bom_delta.txt" tofile="${prep.log.dir}/${build.id}_bom_delta.txt"/> |
|
207 |
||
208 |
<hlm:assertFileExists file="${build.log.dir}/${build.id}_bom_delta.html"/> |
|
209 |
</then> |
|
210 |
</if> |
|
211 |
<hlm:stopSpecificLogMacro name="${prep.log.dir}/${build.id}_bom.log" phase="prep"/> |
|
212 |
</target> |
|
213 |
||
217 | 214 |
<!-- The target create-task-owner-email creates a property task.owners.email which will contain |
179 | 215 |
the list of task owners email IDs seperated by comma, the newly created property can be used thereafter |
216 |
to send emails. |
|
217 | 217 |
This target is automatically called by create-bom target. @scope private--> |
179 | 218 |
<target name="collect-task-owner-email"> |
219 |
<if> |
|
220 |
<available file="${build.log.dir}/${build.id}_bom_delta.xml"/> |
|
221 |
<then> |
|
222 |
<xmltask source="${build.log.dir}/${build.id}_bom_delta.xml" dest="${build.log.dir}/${build.id}_bom_delta.xml"> |
|
223 |
<call path="/bomDelta/content/task"> |
|
224 |
<param name="task.delta" path="text()"/> |
|
225 |
<actions> |
|
226 |
<var name="task.delta" value="@{task.delta}"/> |
|
227 |
<propertyregex property="delta.task.id" input="${task.delta}" regexp="^([^:]+):\s*" select="\1"/> |
|
228 |
<xmltask source="${build.log.dir}/${build.id}_bom.xml" dest="${build.log.dir}/${build.id}_bom.xml"> |
|
229 |
<call path="/bom/content/project/folder/task/owner/text()[../../id[.='${delta.task.id}']]" > |
|
230 |
<param name="task.owner" path="."/> |
|
231 |
<actions> |
|
232 |
<var name="task.owner" value="@{task.owner}"/> |
|
233 |
<if> |
|
588 | 234 |
<isset property="task.owners"/> |
179 | 235 |
<then> |
236 |
<var name="task.owners" value="${task.owners},${task.owner}"/> |
|
237 |
</then> |
|
238 |
<else> |
|
239 |
<var name="task.owners" value="${task.owner}"/> |
|
240 |
</else> |
|
241 |
</if> |
|
242 |
</actions> |
|
243 |
</call> |
|
244 |
</xmltask> |
|
245 |
</actions> |
|
246 |
</call> |
|
247 |
</xmltask> |
|
248 |
</then> |
|
249 |
<else> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
250 |
<if> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
251 |
<available file="${build.log.dir}/${build.id}_bom.xml"/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
252 |
<then> |
179 | 253 |
<xmltask source="${build.log.dir}/${build.id}_bom.xml" dest="${build.log.dir}/${build.id}_bom.xml"> |
254 |
<call path="/bom/content/project/folder/task/owner"> |
|
255 |
<param name="task.owner" path="text()"/> |
|
256 |
<actions> |
|
257 |
<var name="task.owner" value="@{task.owner}"/> |
|
258 |
<if> |
|
588 | 259 |
<isset property="task.owners"/> |
179 | 260 |
<then> |
261 |
<var name="task.owners" value="${task.owners},${task.owner}"/> |
|
262 |
</then> |
|
263 |
<else> |
|
264 |
<var name="task.owners" value="${task.owner}"/> |
|
265 |
</else> |
|
266 |
</if> |
|
267 |
</actions> |
|
268 |
</call> |
|
269 |
</xmltask> |
|
270 |
</then> |
|
271 |
</if> |
|
272 |
</else> |
|
273 |
</if> |
|
587 | 274 |
<script language="jython" setbeans="false"> |
275 |
import re |
|
276 |
taskOwnersDup = project.getProperty("task.owners") |
|
277 |
if taskOwnersDup: |
|
278 |
taskOwnersDup = re.sub(r'\s', '', taskOwnersDup) |
|
279 |
taskOwners = taskOwnersDup.split(',') |
|
280 |
if taskOwners: |
|
281 |
taskOwners = list(set(taskOwners)) |
|
282 |
project.setProperty("task.owners.unique", ",".join(taskOwners)) |
|
283 |
</script> |
|
284 |
<for list="${task.owners.unique}" delimiter="," param="task.owner" > |
|
179 | 285 |
<sequential> |
286 |
<var name="task.owner" value="@{task.owner}"/> |
|
287 |
<if> |
|
588 | 288 |
<isset property="email.ldap.server"/> |
179 | 289 |
<then> |
645 | 290 |
<hlm:ldap url="${email.ldap.server}" rootdn="${email.ldap.rootdn}" filter="uid=${task.owner}" outputproperty="task.owner.email" key="mail" failonerror="false"/> |
588 | 291 |
<if> |
292 |
<isset property="task.owners.email"/> |
|
293 |
<then> |
|
294 |
<var name="task.owners.email" value="${task.owners.email},${task.owner.email}"/> |
|
295 |
</then> |
|
296 |
<else> |
|
297 |
<var name="task.owners.email" value="${task.owner.email}"/> |
|
298 |
</else> |
|
299 |
</if> |
|
300 |
</then> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
301 |
</if> |
179 | 302 |
</sequential> |
303 |
</for> |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
304 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
305 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
306 |
<!-- Finds the path to the last usable XML BOM log for creating a BOM delta. --> |
179 | 307 |
<target name="old-bom-log" unless="old.bom.log"> |
217 | 308 |
<!-- Publish dir location of the old bom log. |
309 |
@type string |
|
310 |
--> |
|
179 | 311 |
<property name="old.bom.log.publish.dir" value="${publish.dir}" /> |
217 | 312 |
<!-- Location of XML BOM log. |
313 |
@type string |
|
314 |
@scope private |
|
315 |
--> |
|
179 | 316 |
<property name="bom.log" value="${old.bom.log.publish.dir}/logs/${build.id}_bom.xml"/> |
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
317 |
<script language="jython" setbeans="false"> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
318 |
import re |
179 | 319 |
import ant |
320 |
import os |
|
321 |
from com.nokia.ant.util import Helper |
|
322 |
||
323 |
previousbuildnumber = 1 |
|
324 |
buildnumber = Helper.getProperty(project, "build.number") |
|
325 |
bomlog = project.getProperty("bom.log") |
|
326 |
while(previousbuildnumber > 0 and previousbuildnumber != ''): |
|
327 |
previousbuildnumber = ant.get_previous_build_number(buildnumber) |
|
328 |
try: |
|
329 |
old_bom_log = re.sub(r'\.(%s)([\/_])' % project.getProperty("build.number"), r'.' + previousbuildnumber + r'\2', bomlog) |
|
330 |
if os.path.exists(old_bom_log): |
|
331 |
break |
|
332 |
except ValueError: |
|
333 |
self.log("Old BOM cannot be found") |
|
334 |
buildnumber = previousbuildnumber |
|
335 |
project.setProperty("old.bom.log", old_bom_log) |
|
1
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
336 |
</script> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
337 |
<echo>Previous BOM log: ${old.bom.log}</echo> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
338 |
<available file="${old.bom.log}" property="old.bom.log.present"/> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
339 |
<echo>Previous BOM log present: ${old.bom.log.present}</echo> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
340 |
</target> |
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
341 |
|
be27ed110b50
Bringing in Helium, imaker and cmaker
Alex Gilkes <alex.gilkes@nokia.com>
parents:
diff
changeset
|
342 |
</project> |