ant config: 'executiondata' in 'group'?

31 views
Skip to first unread message

lvhu...@gmail.com

unread,
Nov 15, 2019, 6:24:25 AM11/15/19
to JaCoCo and EclEmma Users
Hi guys,
can I put the 'executiondata' elememt inside a 'group', as shown below? I have different .exec files for different groups.
Ant complains 'group doesn't support the nested "executiondata" element.' But is there a approach to use different .exec files for different groups? I do need this badly.

    <target name="report">
        <jacoco:report>
            <structure name="JaCoCo-Report">
                <group name="XXX-api">
                    <executiondata>
                        <file file="${jacocoExecPath}/XXX-api.exec"/>
                    </executiondata>
                    <group name="XXX-component-1">
                        <sourcefiles encoding="UTF-8">
                            <fileset dir="${classFilePath}/XXX/WEB-INF/classes"/>
                        </sourcefiles>
                        <classfiles>
                            <fileset dir="${classFilePath}/XXX/WEB-INF/classes"/>
                        </classfiles>
                    </group>
...

Thanks!
--huafeng

Marc Hoffmann

unread,
Nov 15, 2019, 6:35:13 AM11/15/19
to JaCoCo and EclEmma Users
Hi Huafeng,

no, this is not supported.

Why can’t you provide all .exec files for the overall report? Due to unique class ids used by JaCoCo only classes in the respective group will pick-up their data. So there shouldn’t be a difference.

Regards,
-marc



--
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/c13f4c95-1126-4b0e-84a1-6928ceb94349%40googlegroups.com.

lvhu...@gmail.com

unread,
Nov 15, 2019, 7:12:55 AM11/15/19
to JaCoCo and EclEmma Users
For example, I have two modules A and B, and two exec files A.exec and B.exec. The problem is that, A.exec also contains some info about B, but when generating the report, I only want the info about B from B.exec. So I don't want to merge A.exec and B.exec.
Any workaround? Thanks.
--huafeng
To unsubscribe from this group and stop receiving emails from it, send an email to jac...@googlegroups.com.

lvhu...@gmail.com

unread,
Nov 15, 2019, 7:17:48 AM11/15/19
to JaCoCo and EclEmma Users
But maybe I can use 'includes' or 'excludes' when dumping so that A.exec won't include infomation about B?
--huafeng

lvhu...@gmail.com

unread,
Nov 15, 2019, 7:40:11 AM11/15/19
to JaCoCo and EclEmma Users
One more scenario: for unit test we use the mvn command line and jacoco-maven-plugin in pom.xml file. We do defined '<excludes>' in pom.xml, but it seemed to only affect the 'report' part; the generated .exec files were not affected. How can we include or exclude when dumping .exec files? I looked at the doc and seems prepare-agent can do this... is that true? If ture, where can I find some examples?

Thanks.
--huafeng

Marc Hoffmann

unread,
Nov 15, 2019, 7:45:16 AM11/15/19
to JaCoCo and EclEmma Users
Ok, in this case what you typically is do when running the tests that generate A.exec you limit the JaCoCo agent to the classes for A with the includes property of the agent. We do the same for the JaCoCo build itself:


Regards,
-marc


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/2c060059-2a91-4116-972a-96a389a6a1f1%40googlegroups.com.

lvhu...@gmail.com

unread,
Nov 17, 2019, 10:19:33 PM11/17/19
to JaCoCo and EclEmma Users
Thanks Marc. What you suggested is for using jacoco agent, something like this, right?
    <jacoco:dump address="172.29.12.183" port="20488" includes="..." destfile="${jacocoExecPath}/A.exec" reset="false" append="false"/>

Later I asked the mvn plugin scenario (for unit test): for unit test we use the mvn command line and jacoco-maven-plugin in pom.xml file. We do defined '<excludes>' in pom.xml, but it seemed to only affect the 'report' part; the generated .exec files were not affected. How can we include or exclude when dumping .exec files? I looked at the doc and seems prepare-agent can do this... is that true? If ture, where can I find some examples?

Do you have hints or examples for this scenario?

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