ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <>
Subject Re: Possible bug in Delete task
Date Fri, 05 Jul 2002 17:22:12 GMT
--- Stefan Bodewig <> wrote:
> On Sun, 30 Jun 2002, Diane Holt <> wrote:
> > A user posted a question about using <delete> with
> > 'includeEmptyDirs' set, and from looking at, I don't see
> > it ever handling this -- but the doc seems to say it can (but maybe
> > I missed how it's supposed to work).
> The task assumes that your include pattern matches the directories to
> remove - i.e. the dirs are part of getIncludedDirectories.

So, for something like:

Using <delete> as it currently exists, how would you specify the task in
such a way so that any of the subdirs under build that get included in the
fileset (because they include .class files) are deleted if the dir becomes
empty once the .class files in it are deleted. I've tried about a zillion
different ways, and none of them work -- so either I'm just being
incredibly dense, or the current code doesn't do it for you.

> Let's say you have
> <delete includeemptydirs="true">
>   <fileset dir="foo">
>     <include name="**/*.java" />
>   </fileset>
> </delete>
> and a structure like
> foo
>    /bar
>    /baz/
> Is bar going to be removed?  If yes, why?  If not, why not?

I would say not, since it's not a directory included in the generated
fileset, since it doesn't have any .java files. But at this point, I'm so
unclear about what 'includeEmptyDirs' is really suppposed to do (much less
what it actually does do) that my opinion may be meaningless.

> I didn't actually scan for it, but some of your lines didn't look
> properly indented.  You are not using tabs, are you? 8-)

Never -- but I indent my own stuff 2 spaces not 4, so I may have simply
not hit enough spaces at some points.

> You'd probably have to ensure you are not adding directories that are
> explicitly excluded by accident.  Something like
> <delete includeemptydirs="true">
>   <fileset dir="foo">
>     <include name="**/*.java" />
>     <exclude name="baz" />
>   </fileset>
> </delete>
> Your code would delete baz.

It would? How? The directory names that are added to the list are a direct
result of what's returned from the <fileset>, so how is "baz" going to end
up in the list?



Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free

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

View raw message