ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cyril Sagan" <>
Subject empty patternsets?
Date Tue, 20 May 2003 23:04:53 GMT

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" />


<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.

View raw message