Is there an option to exclude classes while generating html report using jacococli.jar?

135 views
Skip to first unread message

Rajasree sivakumar

unread,
Jan 27, 2019, 4:41:13 AM1/27/19
to JaCoCo and EclEmma Users
Currently, I have generated jacoco.exec file (binary coverage report of my FTs)

I am using jacococli.jar to convert jacoco.exec to html report

java -jar jacococli.jar report jacoco.exec --classfiles build/classes/java/main --html FTReport/jacoco-report --name FTReport


Is there an option to exclude certain classes in the above command?
I see no such option in the Jacococli page under 'report' section in https://www.jacoco.org/jacoco/trunk/doc/cli.html 

PS: I could see there are options to exclude when using jacocoagent.jar and NOT while using jacococli.jar

Evgeny Mandrikov

unread,
Jan 28, 2019, 5:25:57 AM1/28/19
to JaCoCo and EclEmma Users


On Sunday, January 27, 2019 at 10:41:13 AM UTC+1, rsiva wrote:
Currently, I have generated jacoco.exec file (binary coverage report of my FTs)

I am using jacococli.jar to convert jacoco.exec to html report

java -jar jacococli.jar report jacoco.exec --classfiles build/classes/java/main --html FTReport/jacoco-report --name FTReport


Is there an option to exclude certain classes in the above command?
I see no such option in the Jacococli page under 'report' section in https://www.jacoco.org/jacoco/trunk/doc/cli.html 

This page documents all available options, and so you don't see, because there is no such.

As a workaround
you can simply remove unwanted files from analyzed directory,
or copy wanted files to directory for analysis.

Also seems that you use Gradle and Gradle JaCoCo Plugin has option to specify list of analyzed classes, despite its misleading name "classDirectories" - https://docs.gradle.org/5.0/dsl/org.gradle.testing.jacoco.tasks.JacocoReport.html#org.gradle.testing.jacoco.tasks.JacocoReport:classDirectories
 
PS: I could see there are options to exclude when using jacocoagent.jar and NOT while using jacococli.jar

"excludes" option of agent has completely different semantic and purpose.

rsiva

unread,
Jan 28, 2019, 10:19:59 AM1/28/19
to JaCoCo and EclEmma Users
Thanks for your reply. 
you can simply remove unwanted files from analyzed directory,
So in my pipeline, the only option I could use is removing the classfiles to be excluded before running the stage to generate coverage.

Also, the classDirectories option you were referring to  - the parameter is to say what classes are to be included.
In my case, there are lots of folders to include and only 2 folders to exclude - so this won't be fulfilling my need

rsiva

unread,
Jan 28, 2019, 10:21:31 AM1/28/19
to JaCoCo and EclEmma Users
Just curious: Will there be an enhancement in jacococli to exclude classes? Since it may be needed by anyone.

Evgeny Mandrikov

unread,
Jan 28, 2019, 10:26:19 AM1/28/19
to JaCoCo and EclEmma Users


On Monday, January 28, 2019 at 4:19:59 PM UTC+1, rsiva wrote:
Thanks for your reply. 
you can simply remove unwanted files from analyzed directory,
So in my pipeline, the only option I could use is removing the classfiles to be excluded before running the stage to generate coverage.

Also, the classDirectories option you were referring to  - the parameter is to say what classes are to be included.
In my case, there are lots of folders to include and only 2 folders to exclude - so this won't be fulfilling my need


classDirectories = fileTree(dir: someDirectory, exclude: ['something/**'])

Evgeny Mandrikov

unread,
Jan 28, 2019, 1:24:11 PM1/28/19
to JaCoCo and EclEmma Users


On Monday, January 28, 2019 at 4:21:31 PM UTC+1, rsiva wrote:
Just curious: Will there be an enhancement in jacococli to exclude classes? Since it may be needed by anyone.


When will feature X be released?

JaCoCo is maintained by volunteers in their free time. Since we cannot guarantee free capacity, we do not commit to particular release dates. Typically, you can expect a couple of releases every year.

In the change log, you can see all features that have been been implemented in master branch and will be available with the next release. And in the meantime you can test latest build of of master branch (Maven SNAPSHOT) and provide feedback to us.


rsiva

unread,
Jan 30, 2019, 9:57:50 AM1/30/19
to JaCoCo and EclEmma Users
Thanks for letting know the options
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages