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