comparison clover-ant.xml @ 25:e6fd2f1eba13

add sonar with clover coverage
author smith@nwoca.org
date Thu, 07 Apr 2011 19:14:15 -0400
parents
children 639bec4999f2
comparison
equal deleted inserted replaced
24:a63acb4e09f8 25:e6fd2f1eba13
1 <?xml version="1.0" encoding="UTF-8"?>
2 <project name="clover-project-tasks" default="" basedir="."
3 xmlns:ivy="antlib:fr.jayasoft.ivy.ant"
4 xmlns:ssdt="http://www.ssdt-ohio.org/ant/common">
5
6 <description>Clover Ant tasks</description>
7
8
9 <target name="-check.clover">
10 <property name="clover.jar.file" value="${user.home.ant.lib}/clover.jar}"/>
11 <property name="ssdt.clover.jar.src"
12 value="http://ivy.ssdt.nwoca.org/repository/clover/clover.jar"/>
13 <property name="clover.dest" value="${build.dir}/clover"/>
14 <ssdt:fetch dest="${clover.jar.file}"
15 src="${ssdt.clover.jar.src}"/>
16 <property name="clover.license"
17 value="${user.home.ant.lib}/clover.license"/>
18 <condition property="clover.installed">
19 <and>
20 <available classname="com.cenqua.clover.CloverInstr" />
21 <available file="${clover.license}"/>
22 </and>
23 </condition>
24 </target>
25
26 <target name="with.coverage" depends="init,-check.clover" if="clover.installed">
27 <taskdef resource="cloverlib.xml"/>
28
29 <property name="coverage.run.with.clover" value="true"/>
30 <clover-env/>
31 <clover-setup recordTestResults="false"/>
32 <clover-clean/>
33 <mkdir dir="${build.dir}/.clover"/>
34 <mkdir dir="${build.dir}/clover"/>
35 </target>
36
37
38 <target name="coverage.xml" description="Generates an XML report to ${clover.dest}." if="coverage.run.with.clover">
39 <clover-report>
40 <current outfile="${clover.dest}/clover.xml" title="${ivy.project.module}" span="${clover.span}">
41 <format type="xml"/>
42 <testresults dir="build/test/results" includes="TEST-*.xml"/>
43 <sourcepath>
44 <pathelement path="${src.dir}"/>
45 </sourcepath>
46 </current>
47 </clover-report>
48 </target>
49
50
51
52 </project>