buildframework/helium/tools/compile/coverity.ant.xml
author timothy.murphy@nokia.com
Tue, 25 May 2010 12:38:07 +0100
branchfix
changeset 574 819bc4ffb37b
parent 217 0f5e3a7fb6af
child 587 85df38eb4012
permissions -rw-r--r--
Release note: Bug 2809 - [Raptor] Intermediate Resource Filenames not unique, rom fails to boot
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
217
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     2
<!-- 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     3
============================================================================ 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     4
Name        : coverity.ant.xml 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     5
Part of     : Helium 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     6
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     7
Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     8
All rights reserved.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
     9
This component and the accompanying materials are made available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    10
under the terms of the License "Eclipse Public License v1.0"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    11
which accompanies this distribution, and is available
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    12
at the URL "http://www.eclipse.org/legal/epl-v10.html".
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    13
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    14
Initial Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    15
Nokia Corporation - initial contribution.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    16
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    17
Contributors:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    18
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    19
Description:
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    20
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    21
============================================================================
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    22
-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    23
<project name="compile.coverity" xmlns:hlm="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    24
    <description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    25
        code-coverity measure.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    26
    </description>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    27
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    28
    <!-- Coverity property declaration and types defination-->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    29
    <!-- coverity output directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    30
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    31
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    32
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    33
    <property name="coverity.output.dir" location="${build.output.dir}/coverity"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    34
    <!-- coverity log directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    35
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    36
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    37
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    38
    <property name="coverity.log.dir" location="${build.log.dir}/coverity"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    39
    <!-- coverity link directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    40
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    41
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    42
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    43
    <property name="coverity.link.dir" value="${coverity.output.dir}/coveritylink"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    44
    <!-- coverity config directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    45
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    46
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    47
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    48
    <property name="coverity.config.dir" value="${coverity.output.dir}/config"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    49
    <!-- coverity analyze directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    50
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    51
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    52
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    53
    <property name="coverity.analyze.dir" value="${coverity.link.dir}/analyze"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    54
    <!-- coverity intermidiate directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    55
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    56
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    57
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    58
    <property name="coverity.inter.dir" value="${coverity.output.dir}/intermidiate"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    59
    <!-- coverity report directory location
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    60
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    61
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    62
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    63
    <property name="coverity.report.dir" value="${coverity.output.dir}/coverity_report_${build.id}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    64
    <!-- coverity report file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    65
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    66
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    67
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    68
    <property name="coverity.report.file" value="${build.id}_coverity_build_report.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    69
    <!-- coverity summary XML file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    70
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    71
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    72
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    73
    <property name="coverity.summary.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_summary.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    74
    <!-- coverity checkers XML file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    75
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    76
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    77
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    78
    <property name="coverity.checkers.xml.file" value="${temp.build.dir}/${build.id}_coverity_build_checkers.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    79
    <!-- diamonds coverity report file name
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    80
    @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    81
    @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    82
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    83
    <property name="diamonds.coverity.report.file" value="${temp.build.dir}/${build.id}_coverity_build_report.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    84
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    85
    <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    86
        <isset property="env.NUMBER_OF_PROCESSORS"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    87
        <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    88
            <math result="coverity.no.thread" operand1="${env.NUMBER_OF_PROCESSORS}" operation="*" operand2="2" datatype="int"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    89
        </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    90
        <else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    91
            <!-- Number of parallel coverity emit threads can run.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    92
            @type string
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    93
            @scope private
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    94
            -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    95
            <property name="coverity.no.thread" value="2"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    96
        </else>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    97
    </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    98
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
    99
    <!-- set property if coverity is enabled -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   100
    <condition property="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   101
        <istrue value="${enabled.coverity}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   102
    </condition>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   103
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   104
    <!-- cov-build command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   105
    <hlm:coverityoptions id="coverity.build.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   106
        <arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   107
        <arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   108
        <arg name="--auto-diff" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   109
        <arg name="--preprocess-first" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   110
        <arg name="--record-only" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   111
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   112
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   113
    <!-- cov-build emit command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   114
    <hlm:coverityoptions id="coverity.emit.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   115
        <arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   116
        <arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   117
        <arg name="--replay" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   118
        <arg name="--replay-processes" value="${coverity.no.thread}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   119
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   120
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   121
    <!-- cov-config command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   122
    <hlm:coverityoptions id="coverity.config.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   123
        <hlm:arg name="--config" value="${coverity.config.dir}/coverity_config.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   124
        <hlm:arg name="--template" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   125
        <hlm:arg name="--comptype" value="armcc"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   126
        <hlm:arg name="--compiler" value="armcc.exe"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   127
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   128
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   129
    <!-- cov-analyze command options -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   130
    <hlm:coverityoptions id="coverity.analyze.options">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   131
        <hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   132
        <hlm:arg name="--all" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   133
        <hlm:arg name="--symbian" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   134
        <hlm:arg name="--append" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   135
        <hlm:arg name="--enable-callgraph-metrics" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   136
    </hlm:coverityoptions>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   137
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   138
    <!-- To run post coverity steps -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   139
    <target name="post-coverity" if="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   140
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   141
        <!-- To emit the file into defect database -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   142
        <antcall target="run-coverity-emit"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   143
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   144
        <!-- To analyze the sources file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   145
        <antcall target="run-coverity-analyze"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   146
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   147
        <!-- To generate the HTML error pages -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   148
        <antcall target="gen-coverity-report"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   149
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   150
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   151
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   152
    <!-- Run coverity configure if the enabled.coverity is set to true -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   153
    <target name="run-coverity-configure" if="run.coverity">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   154
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   155
        <hlm:coverity command="cov-configure" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   156
            <hlm:coverityoptions refid="coverity.config.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   157
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   158
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   159
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   160
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   161
    <!-- Run coverity build with emit options if the enabled.coverity is set to true 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   162
     re-running the cov-build with replay option will reduce the build time by ~ 20% 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   163
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   164
    <target name="run-coverity-emit" >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   165
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   166
        <hlm:coverity command="cov-build" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   167
            <hlm:coverityoptions refid="coverity.emit.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   168
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   169
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   170
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   171
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   172
    <!-- Run coverity-analyze if the enabled.coverity is set to true 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   173
     Sometimes the same file is compiled several times with different command-line options. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   174
     Due to the inherent difficulty of tracking linkage information, the cov-analyze command cannot automatically determine which files are linked together. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   175
     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. 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   176
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   177
     and also
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   178
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   179
     working with link files is faster than collecting data from the intermediate directory multiple times
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   180
     
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   181
     So run the cov-link commands and analyze the database using cov-analyze command.
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   182
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   183
    -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   184
    <target name="run-coverity-analyze" >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   185
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   186
        <mkdir dir="${coverity.link.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   187
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   188
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   189
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   190
            <hlm:arg name="--collect" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   191
            <hlm:arg name="-of" value="${coverity.link.dir}/all.link"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   192
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   193
                
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   194
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   195
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   196
            <hlm:arg name="--compile-arg" value="armv5"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   197
            <hlm:arg name="-of" value="${coverity.link.dir}/armv5.link"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   198
            <hlm:arg name="${coverity.link.dir}/all.link" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   199
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   200
             
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   201
        <hlm:coverity command="cov-link" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   202
            <hlm:arg name="--dir" value="${coverity.inter.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   203
            <hlm:arg name="--output-dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   204
            <hlm:arg name="${coverity.link.dir}/armv5.link" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   205
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   206
                
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   207
        <hlm:coverity command="cov-analyze" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   208
            <hlm:coverityoptions refid="coverity.analyze.options"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   209
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   210
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   211
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   212
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   213
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   214
    <!-- Generate coverity report -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   215
    <target name="gen-coverity-report">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   216
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   217
        <!-- Read the summary file generated by cov-analyze and generate html file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   218
        <fmpp sourceFile="${helium.dir}/tools/common/templates/coverity/coverity.summary.html.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   219
              outputFile="${temp.build.dir}/${build.id}_coverity_build_summary.html">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   220
            <data   expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   221
                    ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   222
                    covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   223
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   224
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   225
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   226
        <!-- To generate summary file for diamonds -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   227
        <fmpp sourceFile="${helium.dir}/tools/common/templates/coverity/coverity.summary.xml.ftl"
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   228
              outputFile="${coverity.summary.xml.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   229
            <data   expandProperties="yes">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   230
                    ant: antProperties()
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   231
                    covsummary: slicedText (${coverity.analyze.dir}/c/output/summary.txt)
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   232
            </data>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   233
        </fmpp>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   234
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   235
        <!-- Run this to get the static html pages -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   236
        <hlm:coverity command="cov-format-errors" dir="${build.drive}/">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   237
            <hlm:arg name="--dir" value="${coverity.analyze.dir}"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   238
            <hlm:arg name="--filesort" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   239
            <hlm:arg name="--functionsort" value=""/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   240
        </hlm:coverity >
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   241
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   242
        <!-- Copy the summary file to resolve the xml load error -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   243
        <copy file="${coverity.analyze.dir}/c/output/errors/summary.xml" tofile="${coverity.checkers.xml.file}" overwrite="true" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   244
            <filterchain>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   245
                <linecontains negate="true">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   246
                    <contains value="config.dtd"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   247
                </linecontains>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   248
            </filterchain>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   249
        </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   250
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   251
        <!-- Insert summary tags into checkers file -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   252
        <xmltask source="${coverity.checkers.xml.file}"  dest="${diamonds.coverity.report.file}" report="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   253
            <insert path="/coverity" file="${coverity.summary.xml.file}"/> 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   254
        </xmltask>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   255
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   256
        <!-- collect all the html files into folder -->        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   257
        <copy todir="${coverity.report.dir}" overwrite="true" failonerror="false">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   258
            <fileset dir="${coverity.analyze.dir}/c/output/errors">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   259
                <exclude name="index.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   260
                <exclude name="**/*.xml"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   261
                <exclude name="summary.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   262
            </fileset>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   263
        </copy>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   264
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   265
        <!-- Concatinate all the html pages to get the final error report page -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   266
        <concat destfile="${coverity.report.dir}/${coverity.report.file}">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   267
            <fileset dir="${temp.build.dir}" includes="${build.id}_coverity_build_summary.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   268
            <fileset dir="${coverity.analyze.dir}/c/output/errors" includes="index.html"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   269
        </concat>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   270
        
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   271
    </target>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   272
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   273
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   274
    <!-- To get the SBS variable value -->
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   275
    <macrodef name="getSBSVariableValue" uri="http://www.nokia.com/helium">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   276
        <attribute name="variablename"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   277
        <attribute name="outputvar"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   278
        <attribute name="sbsinput"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   279
        <sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   280
            <var name="output.var" unset="true"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   281
            <hlm:getVariableValue name="@{variablename}" property="output.var">
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   282
                <hlm:sbsinput refid="@{sbsinput}" />
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   283
            </hlm:getVariableValue>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   284
            <if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   285
                <and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   286
                    <isset property="output.var"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   287
                    <matches string="${output.var}" pattern="arm.*"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   288
                </and>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   289
                <then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   290
                    <antcall target="set-arm-version"/>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   291
                </then>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   292
            </if>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   293
            <script language="beanshell"> <![CDATA[
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   294
                curVal=project.getProperty("output.var"); 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   295
                project.setProperty("@{outputvar}",curVal);
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   296
                ]]>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   297
            </script> 
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   298
        </sequential>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   299
    </macrodef>
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   300
    
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   301
0f5e3a7fb6af helium_8.0-r15308
wbernard
parents:
diff changeset
   302
</project>