comparison jacoco-ant.xml @ 31:0cbc383e341b

TL-34: Handle case of missing coverage data file under sonar
author smith@nwoca.org
date Tue, 12 Apr 2011 16:49:39 -0400
parents ea29594bb799
children 139a3611ae99
comparison
equal deleted inserted replaced
30:22f63ae66fed 31:0cbc383e341b
41 41
42 <target name="coverage.xml" 42 <target name="coverage.xml"
43 description="Generates an XML converage report." 43 description="Generates an XML converage report."
44 depends="-check.jacoco,project.init" 44 depends="-check.jacoco,project.init"
45 if="jacoco.installed"> 45 if="jacoco.installed">
46 <mkdir dir="${jacoco.report.dir}"/> 46 <if><available file="${jacoco.data.file}"/>
47 <jacoco:report> 47 <then>
48 <executiondata> 48 <mkdir dir="${jacoco.report.dir}"/>
49 <file file="${jacoco.data.file}"/> 49 <jacoco:report>
50 </executiondata> 50 <executiondata>
51 <structure name="${ivy.project.module}"> 51 <file file="${jacoco.data.file}"/>
52 <classfiles> 52 </executiondata>
53 <fileset dir="${build.classes.dir}"/> 53 <structure name="${ivy.project.module}">
54 </classfiles> 54 <classfiles>
55 <sourcefiles encoding="UTF-8"> 55 <fileset dir="${build.classes.dir}"/>
56 <fileset dir="${src.dir}"/> 56 </classfiles>
57 </sourcefiles> 57 <sourcefiles encoding="UTF-8">
58 </structure> 58 <fileset dir="${src.dir}"/>
59 <xml destfile="${jacoco.report.dir}/jacoco.xml"/> 59 </sourcefiles>
60 </jacoco:report> 60 </structure>
61 <xml destfile="${jacoco.report.dir}/jacoco.xml"/>
62 </jacoco:report>
63 </then>
64 <else>
65 <echo message="Coverage data not available. coverage.xml skipped"/>
66 </else>
67 </if>
61 68
62 </target> 69 </target>
63 70
64 <target name="coverage.html" 71 <target name="coverage.html"
65 description="Generates an HTML converage report." 72 description="Generates an HTML converage report."