You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Greg Taylor <gt...@workbrain.com> on 2006/09/15 23:14:24 UTC

negating a patternset within a fileset

Hello,

I want to use a patternset to tell a jar task which files to include in
a jar.  Easy enough, but I want to EXclude those same files from another
jar while building the jar from other files in the same directory.  So,
essentially, I want to negate the patternset in the fileset for the
second jar file.  Is there any way to do this?

I have found a solution by moving the patternset patterns into an
includesfile and an excludesfile, however, I'd like to keep the
patternset if possible.  Another solution is to move the files to a temp
directory using the patternset, invoking the jar task, and then moving
them back, but that's a bit messy.

Thanks in advance,
Greg.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: negating a patternset within a fileset

Posted by Dominique Devienne <dd...@gmail.com>.
> I want to use a patternset to tell a jar task which files to include in
> a jar.  Easy enough, but I want to EXclude those same files from another
> jar while building the jar from other files in the same directory.  So,
> essentially, I want to negate the patternset in the fileset for the
> second jar file.  Is there any way to do this?

Not right now, I don't think so. This has been discussed before, to
basically make patternset implement the FileSelector interface, 0but
somehow I don't recall it was implemented.

> I have found a solution by moving the patternset patterns into an
> includesfile and an excludesfile, however, I'd like to keep the
> patternset if possible.

Clever. Didn't think of that.

> Another solution is to move the files to a temp
> directory using the patternset, invoking the jar task, and then moving
> them back, but that's a bit messy.

Yep, this one's not great.

The solution is to use the <filename> selector. Your patterns can be
put into an id'd <or> selector, and used as includes or excludes
simply by having them (the refid'd <or> selector) within a <not> or
not.

--DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org