You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Cyril Sagan <Cy...@sas.com> on 2003/05/21 01:04:53 UTC

empty patternsets?

Ant experts!

Question:  What is the best way to construct an empty patternset,
that is, one matching zero files?

I initially tried this:
	<patternset id="no.files" />

But I soon found out that this matches everything, instead of the
nothing that I had hoped. (The default value/pattern for the include
attribute is "**/*")

While I am able to accomplish what I need with a workaround, I can't
believe there isn't a better way.  The best I could come up with is:

<patternset id="no.files"
            includes="no-way-this-file-could-exist-so-match-nothing" />

or

<patternset id="no.files"  excludes="**/*" />

Thanks in advance for any suggestions for a better solution.

--Cyril Sagan

ps.  I'm sure someone will ask "why are you doing this anyway".  The
goal is to build a set of patterns based on the configuration, then
reference all of the patterset inside fileset, and there is no "if"
attribute to <fileset>.  I can have further discussion about the
implementation details individually.



Re: empty patternsets?

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 20 May 2003, Cyril Sagan <Cy...@sas.com> wrote:

> While I am able to accomplish what I need with a workaround, I can't
> believe there isn't a better way.

I'm not aware of a better way.

Stefan