That works! Thanks a lot, Marc! --huafeng On Friday, November 1, 2019 at 1:22:50 AM UTC+8, Marc R. Hoffmann wrote: > > Hi, > > while I have to admit that I don’t understand your use case I think this > can be solved by providing two file sets: > > <classfiles> > <fileset excludes=“pattern1”/> > <fileset excludes=“pattern2”/> > </classfiles> > > The classfiles tag internally is implemented as a Union. So you can add > multiple resource specifications. So in the end you get all classfiles > which are not excluded in both sets. > > Regards, > -marc > > On 31. Oct 2019, at 10:23, [email protected] <javascript:> wrote: > > Hi, > > How can I intersect two 'excludes' when defining 'fileset' for ant's > report target? > > My situation is, I'm running api test and unit test for the same code. > Each test has its own 'exclude' files. Now I want to merge the two jacoco > report together, and my steps are: > > 1. merge the .exec files dumped by these two tests. This is easy. > 2. use 'ant ... report' to generate the report. So, I need to intersect > the two 'exclude' sets -- that is, classes excluded by both tests will be > excluded; classes excluded by only one of these tests (i.e., not excluded > by the other test) shouldn't be excluded. > > I searched and tried the following approaches: > > 1. as follows, but ant complains "intersect doesn't support the nested > "patternset" element." > <patternset id='id1'> > <exclude name=.../> > <exclude name=.../> > </patternset> > <patternset id='id2'> > <exclude name=.../> > <exclude name=.../> > </patternset> > <intersect id='id3'> > <patternset refid='id1'/> > <patternset refid='id2'/> > </intersect> > > 2. as follows, but ant complains "resources doesn't support the nested > "exclude" element." > <resources id='id1'> > <exclude name=.../> > <exclude name=.../> > </resources> > <resources id='id2'> > <exclude name=.../> > <exclude name=.../> > </resources> > <intersect id='id3'> > <resources refid='id1'/> > <resources refid='id2'/> > </intersect> > ... > <classfiles> > <fileset dir="..."> > <resources refid='excludes'/> > </fileset> > </classfiles> > > 3. as follows, but ant complains "fileset doesn't support the nested > "resources" element" > <patternset id='id1'> > <exclude name=.../> > <exclude name=.../> > </patternset> > <patternset id='id2'> > <exclude name=.../> > <exclude name=.../> > </patternset> > <intersect id='id3'> > <resources refid='id1'/> > <resources refid='id2'/> > </intersect> > ... > <classfiles> > <fileset dir="..."> > <resources refid='excludes'/> > </fileset> > </classfiles> > > So what's the correct way to do this? I'm not familiar with the resource > collections, so any help will be highly appreciated. > > Thanks! > --huafeng > > -- > 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] <javascript:>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jacoco/1f97b34f-aa72-451a-a3ce-23ed5be8382d%40googlegroups.com > > <https://groups.google.com/d/msgid/jacoco/1f97b34f-aa72-451a-a3ce-23ed5be8382d%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > >
-- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/732058dc-8a35-4254-9713-169a7e992c37%40googlegroups.com.
