135 <move file="${prep.log.dir}/bom.txt" tofile="${prep.log.dir}/${build.id}_bom.txt"/> |
135 <move file="${prep.log.dir}/bom.txt" tofile="${prep.log.dir}/${build.id}_bom.txt"/> |
136 |
136 |
137 <!-- Transform bom data into the diamonds xml format: |
137 <!-- Transform bom data into the diamonds xml format: |
138 * BOM folders are flattened into tasks. |
138 * BOM folders are flattened into tasks. |
139 * Schema version is extracted from the appropriate FMPP template. --> |
139 * Schema version is extracted from the appropriate FMPP template. --> |
|
140 <mkdir dir="${temp.build.dir}" /> |
140 <fmpp sourcefile="${helium.dir}/tools/common/templates/diamonds/diamonds_header.ftl" |
141 <fmpp sourcefile="${helium.dir}/tools/common/templates/diamonds/diamonds_header.ftl" |
141 outputfile="${build.temp.dir}/diamonds_header.xml" quiet="true"/> |
142 outputfile="${temp.build.dir}/diamonds_header.xml" quiet="true"/> |
142 <loadfile srcfile="${build.temp.dir}/diamonds_header.xml" property="diamonds.schema.xml"> |
143 <loadfile srcfile="${temp.build.dir}/diamonds_header.xml" property="diamonds.schema.xml"> |
143 <filterchain> |
144 <filterchain> |
144 <linecontains> |
145 <linecontains> |
145 <contains value="schema"/> |
146 <contains value="schema"/> |
146 </linecontains> |
147 </linecontains> |
147 </filterchain> |
148 </filterchain> |
151 <insert path="bom/content" xml="${diamonds.schema.xml}" position="before"/> |
152 <insert path="bom/content" xml="${diamonds.schema.xml}" position="before"/> |
152 <remove path="bom/content/project/folder/name"/> |
153 <remove path="bom/content/project/folder/name"/> |
153 <remove path="bom/build"/> |
154 <remove path="bom/build"/> |
154 <rename path="bom" to="diamonds-build"/> |
155 <rename path="bom" to="diamonds-build"/> |
155 </xmltask> |
156 </xmltask> |
156 <delete file="${build.temp.dir}/diamonds_header.xml"/> |
157 <delete file="${temp.build.dir}/diamonds_header.xml"/> |
157 <replace file="${diamonds.build.output.dir}/create-bom.xml" token="<folder>" value="<!-- <folder> -->"/> |
158 <replace file="${diamonds.build.output.dir}/create-bom.xml" token="<folder>" value="<!-- <folder> -->"/> |
158 <replace file="${diamonds.build.output.dir}/create-bom.xml" token="</folder>" value="<!-- </folder> -->"/> |
159 <replace file="${diamonds.build.output.dir}/create-bom.xml" token="</folder>" value="<!-- </folder> -->"/> |
159 <xmltask source="${diamonds.build.output.dir}/create-bom.xml" dest="${diamonds.build.output.dir}/create-bom.xml" |
160 <xmltask source="${diamonds.build.output.dir}/create-bom.xml" dest="${diamonds.build.output.dir}/create-bom.xml" |
160 outputter="simple"> |
161 outputter="simple"> |
161 <remove path="//comment()"/> |
162 <remove path="//comment()"/> |
213 <call path="/bom/content/project/folder/task/owner/text()[../../id[.='${delta.task.id}']]" > |
214 <call path="/bom/content/project/folder/task/owner/text()[../../id[.='${delta.task.id}']]" > |
214 <param name="task.owner" path="."/> |
215 <param name="task.owner" path="."/> |
215 <actions> |
216 <actions> |
216 <var name="task.owner" value="@{task.owner}"/> |
217 <var name="task.owner" value="@{task.owner}"/> |
217 <if> |
218 <if> |
218 <and> |
219 <isset property="task.owners"/> |
219 <isset property="task.owners"/> |
|
220 </and> |
|
221 <then> |
220 <then> |
222 <var name="task.owners" value="${task.owners},${task.owner}"/> |
221 <var name="task.owners" value="${task.owners},${task.owner}"/> |
223 </then> |
222 </then> |
224 <else> |
223 <else> |
225 <var name="task.owners" value="${task.owner}"/> |
224 <var name="task.owners" value="${task.owner}"/> |
240 <call path="/bom/content/project/folder/task/owner"> |
239 <call path="/bom/content/project/folder/task/owner"> |
241 <param name="task.owner" path="text()"/> |
240 <param name="task.owner" path="text()"/> |
242 <actions> |
241 <actions> |
243 <var name="task.owner" value="@{task.owner}"/> |
242 <var name="task.owner" value="@{task.owner}"/> |
244 <if> |
243 <if> |
245 <and> |
244 <isset property="task.owners"/> |
246 <isset property="task.owners"/> |
|
247 </and> |
|
248 <then> |
245 <then> |
249 <var name="task.owners" value="${task.owners},${task.owner}"/> |
246 <var name="task.owners" value="${task.owners},${task.owner}"/> |
250 </then> |
247 </then> |
251 <else> |
248 <else> |
252 <var name="task.owners" value="${task.owner}"/> |
249 <var name="task.owners" value="${task.owner}"/> |
257 </xmltask> |
254 </xmltask> |
258 </then> |
255 </then> |
259 </if> |
256 </if> |
260 </else> |
257 </else> |
261 </if> |
258 </if> |
262 <sortlist property="task.owners" override="true" value="${task.owners}"/> |
259 <script language="jython" setbeans="false"> |
263 <propertyregex property="task.owners" override="true" input="${task.owners}" regexp="([^,]+),.*\1" replace="\1" global='true'/> |
260 import re |
264 <for list="${task.owners}" delimiter="," param="task.owner" > |
261 taskOwnersDup = project.getProperty("task.owners") |
|
262 if taskOwnersDup: |
|
263 taskOwnersDup = re.sub(r'\s', '', taskOwnersDup) |
|
264 taskOwners = taskOwnersDup.split(',') |
|
265 if taskOwners: |
|
266 taskOwners = list(set(taskOwners)) |
|
267 project.setProperty("task.owners.unique", ",".join(taskOwners)) |
|
268 </script> |
|
269 <for list="${task.owners.unique}" delimiter="," param="task.owner" > |
265 <sequential> |
270 <sequential> |
266 <var name="task.owner" value="@{task.owner}"/> |
271 <var name="task.owner" value="@{task.owner}"/> |
267 <hlm:ldap url="${email.ldap.server}" rootdn="${email.ldap.rootdn}" filter="uid=${task.owner}" outputproperty="task.owner.email" key="mail"/> |
|
268 <if> |
272 <if> |
269 <and> |
273 <isset property="email.ldap.server"/> |
270 <isset property="task.owners.email"/> |
|
271 </and> |
|
272 <then> |
274 <then> |
273 <var name="task.owners.email" value="${task.owners.email},${task.owner.email}"/> |
275 <hlm:ldap url="${email.ldap.server}" rootdn="${email.ldap.rootdn}" filter="uid=${task.owner}" outputproperty="task.owner.email" key="mail"/> |
274 </then> |
276 <if> |
275 <else> |
277 <isset property="task.owners.email"/> |
276 <var name="task.owners.email" value="${task.owner.email}"/> |
278 <then> |
277 </else> |
279 <var name="task.owners.email" value="${task.owners.email},${task.owner.email}"/> |
|
280 </then> |
|
281 <else> |
|
282 <var name="task.owners.email" value="${task.owner.email}"/> |
|
283 </else> |
|
284 </if> |
|
285 </then> |
278 </if> |
286 </if> |
279 </sequential> |
287 </sequential> |
280 </for> |
288 </for> |
281 </target> |
289 </target> |
282 |
290 |