217
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
|
2 |
<!--
|
|
3 |
============================================================================
|
|
4 |
Name : coverity.ant.xml
|
|
5 |
Part of : Helium
|
|
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="compile.coverity" xmlns:hlm="http://www.nokia.com/helium">
|
|
24 |
<description>
|
|
25 |
code-coverity measure.
|
|
26 |
</description>
|
|
27 |
|
|
28 |
<!-- Coverity property declaration and types defination-->
|
628
|
29 |
<!--* @property coverity.enabled
|
587
|
30 |
Value must be set to execute coverity targets.
|
|
31 |
@type boolean
|
|
32 |
@editable required
|
|
33 |
@scope public
|
628
|
34 |
@since 11.0
|
587
|
35 |
-->
|
628
|
36 |
|
|
37 |
<!--* @property internal.coverity.enabled
|
|
38 |
To run coverity related targets if coverity.enabled set to true.
|
|
39 |
@type boolean
|
587
|
40 |
@scope private
|
|
41 |
-->
|
628
|
42 |
|
|
43 |
<!--* @property enabled.coverity
|
|
44 |
Value must be set to execute coverity targets. - deprecated: Start using coverity.enabled property.
|
|
45 |
@type boolean
|
|
46 |
@editable required
|
|
47 |
@scope public
|
|
48 |
@deprecated since 11.0
|
|
49 |
-->
|
|
50 |
|
|
51 |
<!--* @property coverity.commit.defects.enabled
|
|
52 |
Set to true to commit the defects into coverity database.
|
|
53 |
@type boolean
|
|
54 |
@editable required
|
|
55 |
@scope public
|
|
56 |
@since 11.0
|
|
57 |
-->
|
|
58 |
|
645
|
59 |
<!--* @property post.coverity.steps.enabled
|
|
60 |
Set to true to run post coverity steps.
|
|
61 |
@type boolean
|
|
62 |
@scope private
|
|
63 |
@since 11.0.4
|
|
64 |
-->
|
|
65 |
|
|
66 |
<!--* @property is.zero.coverity.errors
|
|
67 |
Set to true if coverity error file contains zero errors.
|
|
68 |
@type boolean
|
|
69 |
@scope private
|
|
70 |
@since 11.0.4
|
|
71 |
-->
|
|
72 |
|
|
73 |
<!--* @property is.zero.coverity.output.errors
|
|
74 |
Set to true if coverity output file contains zero fatal errors.
|
|
75 |
@type boolean
|
|
76 |
@scope private
|
|
77 |
@since 11.0.4
|
|
78 |
-->
|
|
79 |
|
628
|
80 |
<!--* @property internal.coverity.commit.defects.enabled
|
|
81 |
Run the targets to commit the defects into database if coverity.commit.defects.enabled set to true.
|
|
82 |
@type boolean
|
|
83 |
@scope private
|
|
84 |
-->
|
|
85 |
|
|
86 |
<!--* @property coverity.defect.manager.server
|
|
87 |
Coverity defect manager server name or ip address.
|
|
88 |
@type string
|
|
89 |
@editable required
|
|
90 |
@scope public
|
|
91 |
@since 11.0
|
|
92 |
-->
|
|
93 |
|
|
94 |
<!--* @property coverity.defect.manager.port
|
|
95 |
Coverity defect manager server HTTP port or listener port number.
|
|
96 |
@type string
|
|
97 |
@editable required
|
|
98 |
@scope public
|
|
99 |
@since 11.0
|
|
100 |
-->
|
|
101 |
|
|
102 |
<!--* @property coverity.defect.manager.product
|
|
103 |
Coverity defect manager product name to submit the coverity errors.
|
|
104 |
@type string
|
|
105 |
@editable required
|
|
106 |
@scope public
|
|
107 |
@since 11.0
|
|
108 |
-->
|
|
109 |
|
217
|
110 |
<!-- coverity output directory location
|
|
111 |
@type string
|
|
112 |
@scope private
|
|
113 |
-->
|
|
114 |
<property name="coverity.output.dir" location="${build.output.dir}/coverity"/>
|
|
115 |
<!-- coverity log directory location
|
|
116 |
@type string
|
|
117 |
@scope private
|
|
118 |
-->
|
|
119 |
<property name="coverity.log.dir" location="${build.log.dir}/coverity"/>
|
|
120 |
<!-- coverity link directory location
|
|
121 |
@type string
|
|
122 |
@scope private
|
|
123 |
-->
|
|
124 |
<property name="coverity.link.dir" value="${coverity.output.dir}/coveritylink"/>
|
|
125 |
<!-- coverity config directory location
|
|
126 |
@type string
|
|
127 |
@scope private
|
|
128 |
-->
|
|
129 |
<property name="coverity.config.dir" value="${coverity.output.dir}/config"/>
|
|
130 |
<!-- coverity analyze directory location
|
|
131 |
@type string
|
|
132 |
@scope private
|
|
133 |
-->
|
|
134 |
<property name="coverity.analyze.dir" value="${coverity.link.dir}/analyze"/>
|
628
|
135 |
<!-- coverity intermediate directory location
|
217
|
136 |
@type string
|
|
137 |
@scope private
|
|
138 |
-->
|
628
|
139 |
<property name="coverity.inter.dir" value="${coverity.output.dir}/intermediate"/>
|
217
|
140 |
<!-- coverity report directory location
|
|
141 |
@type string
|
|
142 |
@scope private
|
|
143 |
-->
|
|
144 |
<property name="coverity.report.dir" value="${coverity.output.dir}/coverity_report_${build.id}"/>
|
|
145 |
<!-- coverity report file name
|
|
146 |
@type string
|
|
147 |
@scope private
|
|
148 |
-->
|
|
149 |
<property name="coverity.report.file" value="${build.id}_coverity_build_report.html"/>
|
|
150 |
<!-- coverity summary XML file name
|
|
151 |
@type string
|
|
152 |
@scope private
|
|
153 |
-->
|
|
154 |
<property name="coverity.summary.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_summary.xml"/>
|
|
155 |
<!-- coverity checkers XML file name
|
|
156 |
@type string
|
|
157 |
@scope private
|
|
158 |
-->
|
|
159 |
<property name="coverity.checkers.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_checkers.xml"/>
|
|
160 |
<!-- diamonds coverity report file name
|
|
161 |
@type string
|
|
162 |
@scope private
|
|
163 |
-->
|
|
164 |
<property name="diamonds.coverity.report.file" value="${temp.build.dir}/${build.id}_coverity_build_report.xml"/>
|
|
165 |
|
628
|
166 |
<!-- set property if coverity is enabled -->
|
|
167 |
<condition property="internal.coverity.enabled">
|
|
168 |
<or>
|
645
|
169 |
<istrue value="${coverity.enabled}"/>
|
628
|
170 |
<istrue value="${enabled.coverity}"/>
|
|
171 |
</or>
|
|
172 |
</condition>
|
|
173 |
|
|
174 |
<!-- set property if coverity.commit.defects.enabled is enabled -->
|
|
175 |
<condition property="internal.coverity.commit.defects.enabled">
|
645
|
176 |
<istrue value="${coverity.commit.defects.enabled}"/>
|
628
|
177 |
</condition>
|
|
178 |
|
217
|
179 |
<if>
|
|
180 |
<isset property="env.NUMBER_OF_PROCESSORS"/>
|
|
181 |
<then>
|
|
182 |
<math result="coverity.no.thread" operand1="${env.NUMBER_OF_PROCESSORS}" operation="*" operand2="2" datatype="int"/>
|
|
183 |
</then>
|
|
184 |
<else>
|
|
185 |
<!-- Number of parallel coverity emit threads can run.
|
|
186 |
@type string
|
|
187 |
@scope private
|
|
188 |
-->
|
|
189 |
<property name="coverity.no.thread" value="2"/>
|
|
190 |
</else>
|
|
191 |
</if>
|
|
192 |
|
|
193 |
<!-- cov-build command options -->
|
|
194 |
<hlm:coverityoptions id="coverity.build.options">
|
|
195 |
<arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
|
|
196 |
<arg name="--dir" value="${coverity.inter.dir}"/>
|
|
197 |
<arg name="--auto-diff" value=""/>
|
|
198 |
<arg name="--preprocess-first" value=""/>
|
|
199 |
<arg name="--record-only" value=""/>
|
|
200 |
</hlm:coverityoptions>
|
|
201 |
|
|
202 |
<!-- To run post coverity steps -->
|
628
|
203 |
<target name="post-coverity" if="internal.coverity.enabled">
|
|
204 |
<mkdir dir="${post.log.dir}"/>
|
645
|
205 |
|
217
|
206 |
<!-- To emit the file into defect database -->
|
645
|
207 |
<runtarget target="run-coverity-emit"/>
|
|
208 |
|
|
209 |
<!-- To collect linkage information on all files -->
|
|
210 |
<runtarget target="run-coverity-link"/>
|
217
|
211 |
|
|
212 |
<!-- To analyze the sources file -->
|
645
|
213 |
<runtarget target="run-coverity-analyze"/>
|
217
|
214 |
|
|
215 |
<!-- To generate the HTML error pages -->
|
645
|
216 |
<runtarget target="gen-coverity-report"/>
|
628
|
217 |
|
|
218 |
<!-- To commit the defects into coverity defect manager. -->
|
645
|
219 |
<runtarget target="run-commit-defects"/>
|
217
|
220 |
</target>
|
|
221 |
|
628
|
222 |
<!-- Run coverity configure if the coverity.enabled is set to true -->
|
|
223 |
<target name="run-coverity-configure" if="internal.coverity.enabled">
|
645
|
224 |
<mkdir dir="${compile.log.dir}"/>
|
|
225 |
<!-- cov-config command options -->
|
|
226 |
<hlm:coverityoptions id="coverity.config.options">
|
|
227 |
<hlm:arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
|
|
228 |
<hlm:arg name="--template" value=""/>
|
|
229 |
<hlm:arg name="--comptype" value="armcc"/>
|
|
230 |
<hlm:arg name="--compiler" value="armcc.exe"/>
|
|
231 |
</hlm:coverityoptions>
|
|
232 |
<hlm:runCoverityCommand errorlog="${compile.log.dir}/${build.id}_coverity_configure_errors.log"
|
|
233 |
command="cov-configure"
|
|
234 |
options="coverity.config.options"
|
|
235 |
outputlog="${compile.log.dir}/${build.id}_coverity_configure_output.log"
|
|
236 |
/>
|
217
|
237 |
</target>
|
|
238 |
|
628
|
239 |
<!-- Run coverity build with emit options if the coverity.enabled is set to true
|
217
|
240 |
re-running the cov-build with replay option will reduce the build time by ~ 20%
|
|
241 |
-->
|
645
|
242 |
<target name="run-coverity-emit">
|
|
243 |
<!-- cov-build emit command options -->
|
|
244 |
<hlm:coverityoptions id="coverity.emit.options">
|
|
245 |
<arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
|
|
246 |
<arg name="--dir" value="${coverity.inter.dir}"/>
|
|
247 |
<arg name="--replay" value=""/>
|
|
248 |
<arg name="--replay-processes" value="${coverity.no.thread}"/>
|
|
249 |
</hlm:coverityoptions>
|
|
250 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_emit_errors.log"
|
|
251 |
command="cov-build"
|
|
252 |
options="coverity.emit.options"
|
|
253 |
outputlog="${post.log.dir}/${build.id}_coverity_emit_output.log"
|
|
254 |
/>
|
217
|
255 |
</target>
|
|
256 |
|
628
|
257 |
<!-- Run coverity-analyze if the coverity.enabled is set to true
|
217
|
258 |
Sometimes the same file is compiled several times with different command-line options.
|
|
259 |
Due to the inherent difficulty of tracking linkage information, the cov-analyze command cannot automatically determine which files are linked together.
|
|
260 |
To avoid errors in function call resolution (especially in C code, which doesn't have any name mangling), use the cov-link command to get this information.
|
|
261 |
|
|
262 |
and also
|
|
263 |
|
|
264 |
working with link files is faster than collecting data from the intermediate directory multiple times
|
|
265 |
|
|
266 |
So run the cov-link commands and analyze the database using cov-analyze command.
|
|
267 |
|
|
268 |
-->
|
645
|
269 |
<target name="run-coverity-link" if="post.coverity.steps.enabled">
|
217
|
270 |
<mkdir dir="${coverity.link.dir}"/>
|
645
|
271 |
|
|
272 |
<!-- Run cov-link with the -co and -of options to collect linkage information on all files compiled in an emit directory.-->
|
|
273 |
<hlm:coverityoptions id="coverity.link.all.options">
|
217
|
274 |
<hlm:arg name="--dir" value="${coverity.inter.dir}"/>
|
|
275 |
<hlm:arg name="--collect" value=""/>
|
|
276 |
<hlm:arg name="-of" value="${coverity.link.dir}/all.link"/>
|
645
|
277 |
</hlm:coverityoptions>
|
|
278 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_link_errors.log"
|
|
279 |
command="cov-link"
|
|
280 |
options="coverity.link.all.options"
|
|
281 |
outputlog="${post.log.dir}/${build.id}_coverity_link_output.log"
|
|
282 |
/>
|
|
283 |
|
|
284 |
<!--Create one or more additional link files by filtering information using either an argument or a portion
|
|
285 |
of the pathname that was used during command-line compilation-->
|
|
286 |
<hlm:coverityoptions id="coverity.link.options">
|
217
|
287 |
<hlm:arg name="--dir" value="${coverity.inter.dir}"/>
|
|
288 |
<hlm:arg name="--compile-arg" value="armv5"/>
|
|
289 |
<hlm:arg name="-of" value="${coverity.link.dir}/armv5.link"/>
|
|
290 |
<hlm:arg name="${coverity.link.dir}/all.link" value=""/>
|
645
|
291 |
</hlm:coverityoptions>
|
|
292 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_link_errors.log"
|
|
293 |
append="true"
|
|
294 |
command="cov-link"
|
|
295 |
options="coverity.link.options"
|
|
296 |
outputlog="${post.log.dir}/${build.id}_coverity_link_output.log"
|
|
297 |
/>
|
|
298 |
|
|
299 |
<!--Use the link files created in the previous steps, and the emit repository in the original intermediate directory, to create a new
|
|
300 |
intermediate directory with an emit repository with resolved function calls -->
|
|
301 |
<hlm:coverityoptions id="coverity.link.extract.options">
|
217
|
302 |
<hlm:arg name="--dir" value="${coverity.inter.dir}"/>
|
|
303 |
<hlm:arg name="--output-dir" value="${coverity.analyze.dir}"/>
|
|
304 |
<hlm:arg name="${coverity.link.dir}/armv5.link" value=""/>
|
645
|
305 |
</hlm:coverityoptions>
|
|
306 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_link_errors.log"
|
|
307 |
append="true"
|
|
308 |
command="cov-link"
|
|
309 |
options="coverity.link.extract.options"
|
|
310 |
outputlog="${post.log.dir}/${build.id}_coverity_link_output.log"
|
|
311 |
/>
|
|
312 |
</target>
|
|
313 |
|
|
314 |
<!-- To analyze the sources file -->
|
|
315 |
<target name="run-coverity-analyze" if="post.coverity.steps.enabled">
|
|
316 |
|
|
317 |
<!-- cov-analyze command options -->
|
|
318 |
<hlm:coverityoptions id="coverity.analyze.options">
|
|
319 |
<hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
|
|
320 |
<hlm:arg name="--all" value=""/>
|
|
321 |
<hlm:arg name="--symbian" value=""/>
|
|
322 |
<hlm:arg name="--append" value=""/>
|
|
323 |
<hlm:arg name="--enable-callgraph-metrics" value=""/>
|
|
324 |
</hlm:coverityoptions>
|
|
325 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_analyze_errors.log"
|
|
326 |
command="cov-analyze"
|
|
327 |
options="coverity.analyze.options"
|
|
328 |
outputlog="${post.log.dir}/${build.id}_coverity_analyze_output.log"
|
|
329 |
/>
|
|
330 |
|
217
|
331 |
</target>
|
|
332 |
|
|
333 |
|
|
334 |
<!-- Generate coverity report -->
|
645
|
335 |
<target name="gen-coverity-report" if="post.coverity.steps.enabled">
|
217
|
336 |
<!-- Read the summary file generated by cov-analyze and generate html file -->
|
645
|
337 |
<fmpp sourceFile="${helium.dir}/tools/compile/templates/coverity.summary.html.ftl"
|
217
|
338 |
outputFile="${temp.build.dir}/${build.id}_coverity_build_summary.html">
|
|
339 |
<data expandProperties="yes">
|
|
340 |
ant: antProperties()
|
|
341 |
covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
|
|
342 |
</data>
|
|
343 |
</fmpp>
|
|
344 |
|
|
345 |
<!-- To generate summary file for diamonds -->
|
645
|
346 |
<fmpp sourceFile="${helium.dir}/tools/compile/templates/coverity.summary.xml.ftl"
|
217
|
347 |
outputFile="${coverity.summary.xml.file}">
|
|
348 |
<data expandProperties="yes">
|
|
349 |
ant: antProperties()
|
|
350 |
covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
|
|
351 |
</data>
|
|
352 |
</fmpp>
|
|
353 |
|
|
354 |
<!-- Run this to get the static html pages -->
|
645
|
355 |
<hlm:coverityoptions id="coverity.format.errors.options">
|
217
|
356 |
<hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
|
|
357 |
<hlm:arg name="--filesort" value=""/>
|
|
358 |
<hlm:arg name="--functionsort" value=""/>
|
645
|
359 |
</hlm:coverityoptions>
|
|
360 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_format_errors.log"
|
|
361 |
command="cov-format-errors"
|
|
362 |
options="coverity.format.errors.options"
|
|
363 |
outputlog="${post.log.dir}/${build.id}_coverity_format_ouput.log"
|
|
364 |
/>
|
217
|
365 |
|
|
366 |
<!-- Copy the summary file to resolve the xml load error -->
|
|
367 |
<copy file="${coverity.analyze.dir}/c/output/errors/summary.xml" tofile="${coverity.checkers.xml.file}" overwrite="true" failonerror="false">
|
|
368 |
<filterchain>
|
|
369 |
<linecontains negate="true">
|
|
370 |
<contains value="config.dtd"/>
|
|
371 |
</linecontains>
|
|
372 |
</filterchain>
|
|
373 |
</copy>
|
|
374 |
|
|
375 |
<!-- Insert summary tags into checkers file -->
|
|
376 |
<xmltask source="${coverity.checkers.xml.file}" dest="${diamonds.coverity.report.file}" report="false">
|
|
377 |
<insert path="/coverity" file="${coverity.summary.xml.file}"/>
|
|
378 |
</xmltask>
|
|
379 |
|
|
380 |
<!-- collect all the html files into folder -->
|
|
381 |
<copy todir="${coverity.report.dir}" overwrite="true" failonerror="false">
|
|
382 |
<fileset dir="${coverity.analyze.dir}/c/output/errors">
|
|
383 |
<exclude name="index.html"/>
|
|
384 |
<exclude name="**/*.xml"/>
|
|
385 |
<exclude name="summary.html"/>
|
|
386 |
</fileset>
|
|
387 |
</copy>
|
|
388 |
|
|
389 |
<!-- Concatinate all the html pages to get the final error report page -->
|
|
390 |
<concat destfile="${coverity.report.dir}/${coverity.report.file}">
|
|
391 |
<fileset dir="${temp.build.dir}" includes="${build.id}_coverity_build_summary.html"/>
|
|
392 |
<fileset dir="${coverity.analyze.dir}/c/output/errors" includes="index.html"/>
|
|
393 |
</concat>
|
|
394 |
</target>
|
|
395 |
|
628
|
396 |
<!-- To commit the coverity defects into coverity defect manager -->
|
|
397 |
<target name="run-commit-defects" depends="coverity-username,coverity-password" if="internal.coverity.commit.defects.enabled">
|
645
|
398 |
<if>
|
|
399 |
<istrue value="${post.coverity.steps.enabled}"/>
|
|
400 |
<then>
|
|
401 |
<mkdir dir="${post.log.dir}"/>
|
|
402 |
<!-- Check is the coverity defect manager server and port numbers are set -->
|
|
403 |
<fail message="FAILED: Coverity defect manager server/IP address is not set. Please set 'coverity.defect.manager.server'. Ex: server.domain.extension or 100.220.530.101"
|
|
404 |
unless="coverity.defect.manager.server"/>
|
|
405 |
<fail message="FAILED: Coverity defect manager HTTP port number is not set. Please set 'coverity.defect.manager.port'."
|
|
406 |
unless="coverity.defect.manager.port"/>
|
|
407 |
<!-- Check is the coverity defect manager server product is set to submit the coverity errors.-->
|
|
408 |
<fail message="FAILED: Coverity defect manager product name is not set. Please set 'coverity.defect.manager.product'."
|
|
409 |
unless="coverity.defect.manager.product"/>
|
|
410 |
|
|
411 |
<!-- cov-commit-defects command options -->
|
|
412 |
<hlm:coverityoptions id="coverity.commit.defects.options">
|
|
413 |
<hlm:arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
|
|
414 |
<hlm:arg name="--remote" value="${coverity.defect.manager.server}"/>
|
|
415 |
<hlm:arg name="--port" value="${coverity.defect.manager.port}"/>
|
|
416 |
<hlm:arg name="--user" value="${coverity.username}"/>
|
|
417 |
<hlm:arg name="--password" value="${coverity.password}"/>
|
|
418 |
<hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
|
|
419 |
<hlm:arg name="--product" value="${coverity.defect.manager.product}"/>
|
|
420 |
</hlm:coverityoptions>
|
|
421 |
|
|
422 |
<!-- Run the coverity commit defects command to submit the errors into defect manager -->
|
|
423 |
<hlm:runCoverityCommand errorlog="${post.log.dir}/${build.id}_coverity_commit_defects_errors.log"
|
|
424 |
command="cov-commit-defects"
|
|
425 |
options="coverity.commit.defects.options"
|
|
426 |
outputlog="${post.log.dir}/${build.id}_coverity_commit_defects_ouput.log"
|
|
427 |
/>
|
|
428 |
</then>
|
|
429 |
</if>
|
628
|
430 |
</target>
|
|
431 |
|
|
432 |
<!-- Retrieve the coverity password from the .netrc file and store it into coverity.password property. -->
|
|
433 |
<target name="coverity-password" if="internal.coverity.commit.defects.enabled">
|
|
434 |
<hlm:netrcPasswordMacro output-prop="coverity.password" result-prop="coverity.password.available" type="coverity"/>
|
|
435 |
<hlm:logreplace regexp="coverity.password"/>
|
|
436 |
</target>
|
|
437 |
|
|
438 |
<!-- Retrieve the coverity username from the .netrc file and store it into coverity.username property. -->
|
|
439 |
<target name="coverity-username" if="internal.coverity.commit.defects.enabled">
|
|
440 |
<hlm:netrcUsernameMacro output-prop="coverity.username" result-prop="coverity.username.available" type="coverity"/>
|
|
441 |
</target>
|
|
442 |
|
645
|
443 |
|
|
444 |
<!-- To run coverity command and to check errors thrown by coverity commands -->
|
|
445 |
<macrodef name="runCoverityCommand" uri="http://www.nokia.com/helium">
|
|
446 |
<attribute name="errorlog"/>
|
|
447 |
<attribute name="outputlog"/>
|
|
448 |
<attribute name="command"/>
|
|
449 |
<attribute name="append" default="false"/>
|
|
450 |
<attribute name="options"/>
|
|
451 |
<sequential>
|
|
452 |
<var name="is.zero.coverity.errors" unset="true"/>
|
|
453 |
<var name="is.zero.coverity.output.errors" unset="true"/>
|
|
454 |
<var name="post.coverity.steps.enabled" unset="true"/>
|
|
455 |
<var name="total.coverity.errors" unset="true"/>
|
|
456 |
<var name="total.coverity.output.errors" unset="true"/>
|
|
457 |
<hlm:coverity command="@{command}" dir="${build.drive}/" error="@{errorlog}" append="@{append}" output="@{outputlog}">
|
|
458 |
<hlm:coverityoptions refid="@{options}"/>
|
|
459 |
</hlm:coverity>
|
|
460 |
<hlm:metadatarecord database="${metadata.dbfile}">
|
|
461 |
<hlm:coveritymetadatainput>
|
|
462 |
<fileset casesensitive="false" file="@{errorlog}"/>
|
|
463 |
<metadatafilterset refid="filterset.coverity.error.cli"/>
|
|
464 |
</hlm:coveritymetadatainput>
|
|
465 |
</hlm:metadatarecord>
|
|
466 |
<hlm:metadataCountSeverity severity="ERROR" log="@{errorlog}" database="${metadata.dbfile}" property="total.coverity.errors"/>
|
|
467 |
<echo>Coverity command '@{command}' errors: ${total.coverity.errors}</echo>
|
|
468 |
<condition property="is.zero.coverity.errors">
|
|
469 |
<equals arg1="${total.coverity.errors}" arg2="0"/>
|
|
470 |
</condition>
|
|
471 |
<hlm:generateBuildStatus file="@{errorlog}"/>
|
|
472 |
<hlm:signalMacro logfile="@{errorlog}" phase="post" signal.input="coveritySignalInput"/>
|
|
473 |
<if>
|
|
474 |
<available file="@{outputlog}" />
|
|
475 |
<then>
|
|
476 |
<hlm:metadatarecord database="${metadata.dbfile}">
|
|
477 |
<hlm:coveritymetadatainput>
|
|
478 |
<fileset casesensitive="false" file="@{outputlog}"/>
|
|
479 |
<metadatafilterset refid="filterset.coverity.output.cli"/>
|
|
480 |
</hlm:coveritymetadatainput>
|
|
481 |
</hlm:metadatarecord>
|
|
482 |
<hlm:metadataCountSeverity severity="ERROR" log="@{outputlog}" database="${metadata.dbfile}" property="total.coverity.output.errors"/>
|
|
483 |
<echo>Coverity command '@{command}' errors: ${total.coverity.output.errors}</echo>
|
|
484 |
<condition property="is.zero.coverity.output.errors">
|
|
485 |
<equals arg1="${total.coverity.output.errors}" arg2="0"/>
|
|
486 |
</condition>
|
|
487 |
<hlm:generateBuildStatus file="@{outputlog}"/>
|
|
488 |
<hlm:signalMacro logfile="@{outputlog}" phase="post" signal.input="coveritySignalInput"/>
|
|
489 |
</then>
|
|
490 |
</if>
|
|
491 |
<condition property="post.coverity.steps.enabled">
|
|
492 |
<and>
|
|
493 |
<istrue value="${is.zero.coverity.errors}"/>
|
|
494 |
<istrue value="${is.zero.coverity.output.errors}"/>
|
|
495 |
</and>
|
|
496 |
</condition>
|
|
497 |
</sequential>
|
|
498 |
</macrodef>
|
217
|
499 |
</project>
|