Hi Marc,
I am using apache-ant-1.8.2 version. Please find attached buxil.xml file.
Thanks,
Dhinesh
On Friday, July 11, 2014 11:55:37 AM UTC+5:30, Marc R. Hoffmann wrote:
> Hi Dhinesh,
>
> that's strange. Looks like your Ant installation does not know the built
> in type 'file'.
>
> - What version of Ant are you using?
> - Can you please provide your build file?
>
> Regards,
> -marc
>
> On 10.07.14 13:22, [email protected] <javascript:> wrote:
>
> Hi,
>
> I am using JaCoCo with ANT task for my sample application.
>
> I am following the sample ANT task (below link) which is given in the
> JaCoCo >
> Documentationhttp://www.eclemma.org/jacoco/trunk/doc/examples/build/build.xml
>
> I got the below error while executing the <jacoco:report> task.
>
> Class org.apache.tools.ant.types.resources.Union doesn't support the
> nested "file" element.
>
> Kindly please suggest me how to solve this issue.
>
> Thanks
> Dhinesh
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:jacoco="antlib:org.jacoco.ant" default="rebuild" name="HelloWorld" >
<property name="src.dir" location="./src/main/java"/>
<property name="temp.dir" location="./target"/>
<property name="temp.classes.dir" location="${temp.dir}/classes" />
<property name="temp.report.dir" location="${temp.dir}/site/jacoco" />
<!-- <property name="temp.exec.file" location="${temp.dir}/report.xml" /> -->
<property name="temp.exec.file" location="${temp.dir}/jacoco.exec" />
<taskdef resource="org/jacoco/ant/antlib.xml" uri="antlib:org.jacoco.ant" >
<classpath path="D:/jacoco-0.7.1.2/lib/jacocoant.jar" />
<classpath path="D:/jacoco-0.7.1.2/lib/org.jacoco.report-0.7.1.201405082137.jar" />
<classpath path="D:/jacoco-0.7.1.2/lib/ant.jar" />
</taskdef>
<target name="clean">
<delete dir="${temp.dir}" />
</target>
<target name="compile">
<mkdir dir="${temp.classes.dir}" />
<javac includeantruntime="false" debug="true" destdir="${temp.classes.dir}" srcdir="${src.dir}"/>
</target>
<target name="test" depends="compile">
<!-- Step 2: Wrap test execution with the JaCoCo coverage task -->
<jacoco:coverage destfile="${temp.exec.file}" output="file">
<java fork="true" classname="org.abc.examples.util.HelloWorldTestCase1" >
<classpath path="${temp.classes.dir}" />
</java>
</jacoco:coverage>
<!-- <jacoco:agent property="agentvmparam"/> -->
</target>
<target name="report" depends="test">
<!-- Step 3: Create coverage report -->
<jacoco:report>
<!-- This task needs the collected execution data and ... -->
<executiondata>
<file file="${temp.exec.file}" />
</executiondata>
<!-- the class files and optional source files ... -->
<structure name="JaCoCo Ant Example">
<classfiles>
<fileset dir="${temp.classes.dir}" />
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${src.dir}" />
</sourcefiles>
</structure>
<!-- to produce reports in different formats. -->
<html destdir="${temp.report.dir}" />
</jacoco:report>
</target>
<target name="dump">
<jacoco:dump address="server.example.com" reset="true" destfile="${temp.exec.file}"/>
</target>
<target name="rebuild" depends="clean,compile,test,report" />
</project>