Filesets in Ant

P

Pedro Miller

Hi everyone,

I'm having a problem masking excludes in Ant. I've got something like
this:

file1.txt
file2.txt
file3.txt
file4.txt
file5.txt
file6.txt
other1.txt
other2.txt

How can I create a patternset that includes:

* Every .txt file, except:
o Files named "file*.txt", which should be excluded, except:
+ Files named "file1.txt" or "file2.txt", which should
be included

The resulting set should be:

file1.txt
file2.txt
other1.txt
other2.txt

Of course, in my real-world situation I have a quite larger number of
files and enumerating "file[^12].txt" is not acceptable.

I'm trying to use <patternset> so I can reuse it in several <fileset>s.
I tried something like this:

<patternset id="libFB.resFileSet">
<include name="*.txt" />
<exclude name="file*.txt" />
<include name="file1.txt" />
<include name="file2.txt" />
</patternset>

....but it doesn't -- the exclude takes precedence.

Thanks in advance!

Pedro
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top