Re: [java code coverage] jacoco coverage ant task excluding classes not working

612 views
Skip to first unread message

Marc Hoffmann

unread,
Sep 12, 2016, 7:33:08 AM9/12/16
to jac...@googlegroups.com
What do you mean by "no of classes are equal"?

It helps to formulate questions or error reports like this:

1) STEPS TO REPRODUCE (ok, I see your script)
2) EXPECTED BEHAVIOUR
3) ACTUAL BEHAVIOR


Regards,
-marc



On 2016-09-09 12:05, Saurabh Garg wrote:
> Hi All,
> I am using below ant script with jacoco ant jar to generate jacoco
> report files
>
> <jacoco:report>
> <executiondata>
> <file file="merged.exec"/>
> </executiondata>
> <structure name="Galore Project">
> <classfiles>
> <fileset dir="classes"/>
> </classfiles>
> <sourcefiles encoding="UTF-8">
> <fileset dir="src"/>
> </sourcefiles>
> </structure>
>
> <xml destfile="jacoco/report.xml"/>
> </jacoco:report>
>
> i want to exclude some classes that are no longer in use to do that i
> added below snippet
>
> jacoco:report>
> <executiondata>
> <file file="merged.exec"/>
> </executiondata>
> <structure name="Galore Project">
> <classfiles>
> <fileset dir="classes">
> <exclude
> name="**/A*.class"/>
> </fileset>
> </classfiles>
> <sourcefiles encoding="UTF-8">
> <fileset dir="src"/>
> </sourcefiles>
> </structure>
>
> <xml destfile="jacoco/report.xml"/>
>
> </jacoco:report>
> but for both out come is same no of classes are equal when i ran the
> both scripts.
>
> Please suggest resolution for the same.
>
> Thanks and regards
> Saurabh
>
> --
> 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 jacoco+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jacoco/5f5ceded-a464-475e-82eb-ba432e2654a1%40googlegroups.com
> [1].
> For more options, visit https://groups.google.com/d/optout.
>
>
> Links:
> ------
> [1]
> https://groups.google.com/d/msgid/jacoco/5f5ceded-a464-475e-82eb-ba432e2654a1%40googlegroups.com?utm_medium=email&utm_source=footer

Saurabh Garg

unread,
Sep 13, 2016, 5:45:02 AM9/13/16
to JaCoCo and EclEmma Users
Hi Marc,


I am building on jacoco 7.4 .
In first build I have 257 classes in my project. But I want to exclude some 23 classes as they are not required for present build.
So, I wrote the exclude tag that ignores the package in which these classes are kept.

Then I build the project again.
Ideally that package will be excluded and no of classes should be reduced to 234 that are used in coverage.
But in build no of classes are still 257.
So those 23 classes were not excluded.

So I want to know how to do that.

Regards
Saurabh

Marc Hoffmann

unread,
Sep 13, 2016, 7:51:14 AM9/13/16
to jac...@googlegroups.com
Hi,

what is the content of your classes folder? Only *.class files or also
JAR files? In the latter the Ants exclude rule would not exclude class
files from within the JAR file.

You can test the fileset with any other Ant task, e.g. copy.

Regards,
-marc

Saurabh Garg

unread,
Sep 14, 2016, 12:34:54 AM9/14/16
to JaCoCo and EclEmma Users
hi Marc,

The contents of classes folder is classes only we are not puting any jars there.

Ok i will test fileset with any other task and update you.

Thanks 
Saurabh
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages