Add cobertura task.

This commit is contained in:
Michael Vehrs 2009-11-04 17:11:47 +00:00
parent a0822ee8f1
commit cc6c52c084
1 changed files with 38 additions and 0 deletions

View File

@ -736,4 +736,42 @@
</java>
</target>
<target name="cobertura" depends="build">
<property name="cobertura.dir" value="cobertura" />
<path id="cobertura.classpath">
<fileset dir="${cobertura.dir}">
<include name="cobertura.jar" />
<include name="lib/**/*.jar" />
</fileset>
</path>
<taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
<cobertura-instrument todir="build/instrumented-classes">
<fileset dir="build/net">
<include name="**/*.class"/>
</fileset>
</cobertura-instrument>
<delete dir="${freecol.build.dir}/report" />
<mkdir dir="${freecol.build.dir}/report"/>
<mkdir dir="${freecol.build.dir}/report/xml"/>
<echo message="if the next task fails then please read the build script" />
<junit printsummary="on" errorproperty="error.junit" fork="yes" maxmemory="48m">
<classpath location="build/instrumented-classes"/>
<classpath location="build/net"/>
<classpath refid="cobertura.classpath"/>
<classpath refid="test.run.classpath"/>
<formatter type="xml" />
<test todir="${freecol.build.dir}/report/xml" name="net.sf.freecol.AllTests" fork="yes"/>
<sysproperty key="java.awt.headless" value="true" />
</junit>
<cobertura-report srcdir="${freecol.src.dir}" destdir="cobertura/report"/>
</target>
</project>