ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roger Whitcomb <>
Subject Re: Question about Copy task with empty PatternSet
Date Fri, 16 May 2014 05:26:40 GMT
Well, that basically worked. But I had to put the "exclude" not in the PatternSet itself, but
in the FileSet that referenced the PatternSet, like this:
<FileSet dir=".">
   <PatternSet refid="other-jars"/>
   <exclude name="*" unless=""/>

Not totally ideal, maybe, but it does work. I think what you said would work with the incomplete
example I gave, but I also was using the PatternSet sometimes in conjunction with other PatternSets
and the exclude in those cases messed me up (excluded everything when I didn't want to). 
But the idea does work in that having both the include and the exclude gives a non-empty file
list always, whether the feature is enabled or not, which avoids the problem of an empty list
implying "copy everything". 

So, thank you very much!

~Roger Whitcomb

> On May 14, 2014, at 9:04 PM, Antoine Levy Lambert <> wrote:
> Hi,
> you can try this  (untested):
>> <PatternSet id="other-jars">
>>   <include name="abc*.jar" if="”/>
>      <exclude name=“**/*” unless=“”/>
>> </PatternSet>
> The idea is to add an exclude element which fill fire only if is not set.
> Regards,
> Antoine
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message