putting all <excludes> together?

29 views
Skip to first unread message

lvhu...@gmail.com

unread,
Oct 28, 2019, 10:34:50 PM10/28/19
to JaCoCo and EclEmma Users
hi,

I was using 'ant -buildfile build.xml report' to generate html report. Part of build.xml looks like this. Clearly the <exclude>s are inside each <fileset> of <classfiles>. My question is, can all these <exclude>s be put together outside the <classfiles><fileset>, in the 'top level' of <group name="my-hello-api-top">? If so, how would build.xml look like?

   <target name="report">
        <jacoco:report>
            <executiondata>
                <file file="${jacocoExecPath}/merged.exec"/>
            </executiondata>

            <structure name="JaCoCo Report">
                <group name="my-hello-api-top">
                    <group name="my-hello-api">
                        <sourcefiles encoding="UTF-8">
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/classes"/>
                        </sourcefiles>
                        <classfiles>
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/classes">
                                <exclude name="com/my/hello/api/debug/**/*.class"/>
                                <exclude name="com/my/hello/api/downgrade/*.class"/>
                                <exclude name="com/my/hello/api/base/*.class"/>
                            </fileset>
                        </classfiles>
                    </group>
                    <group name="my-hello-component">
                        <sourcefiles encoding="UTF-8">
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/lib/my-hello-component"/>
                        </sourcefiles>
                        <classfiles>
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/lib/my-hello-component"/>
                        </classfiles>
                    </group>
                    <group name="my-hello-model">
                        <sourcefiles encoding="UTF-8">
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/lib/my-hello-model"/>
                        </sourcefiles>
                        <classfiles>
                            <fileset dir="${classFilePath}/my-hello-api-version/WEB-INF/lib/my-hello-model">
                                <exclude name="com/my/hello/**/*.class"/>
                            </fileset>
                        </classfiles>
                    </group>
                </group>
......

Thanks!
--huafeng

Marc Hoffmann

unread,
Oct 29, 2019, 2:49:01 AM10/29/19
to JaCoCo and EclEmma Users
Hi Huafeng,

you can define the excludes in a file and reference this file with the excludesfile property of FileSet. See Ant documentation: https://ant.apache.org/manual/Types/fileset.html

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/581390c2-c2cb-447d-9c83-ea49a95dcc2d%40googlegroups.com.

lvhu...@gmail.com

unread,
Oct 31, 2019, 5:24:16 AM10/31/19
to JaCoCo and EclEmma Users
Thanks Marc!
To unsubscribe from this group and stop receiving emails from it, send an email to jac...@googlegroups.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages