ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liz Burke-Scovill" <>
Subject Re: Bringing up an old issue that was never addressed: includeemptydirs on delete
Date Mon, 08 May 2006 19:58:35 GMT
On 5/8/06, Dominique Devienne <> wrote:
> Liz, I'm still not 100% sure I understand your use case now ;-)
> Would you mind providing a simplified sample listing of the files in
> your directory before <delete>, the XML snippet for the <delete> tag
> with its nested elements you're using, and which files you expect to
> get deleted?

sure - though expect is loaded. Again - this is what I would *expect* based
on perceived usage - rather than implemented logic. Does that make sense? I
understand what delete currently does...and technically how it does it.
That's not the problem. The problem is now discussing whether or not delete
could be implemented such that includeemptydirs actually has meaning for
both includes and excludes, if that makes sense? Right now in the current
implementation, includeemptydirs has no functional meaning, unless you
happen to have a patternset that includes the name of the directory/ies in
question....I'm talking about cleaning up empty dirs when doing a delete.

Before <delete>:


XML snippet:

<delete includeemptydirs="true">
    <fileset dir="test" includes="**/*.ini" />

Actual outcome:

test/something.ini and test/test1/test2/another.ini are deleted - this is
also expected based on current implementation.

Desired outcome:

files test/something.ini, test/test1/test2/another.ini deleted
dirs test3 and test2 deleted as both are now empty.

Using an excludes pattern of <fileset dir="test" excludes="**/*.txt" />, it
does exactly as desired, but it's kind of hacky as you
have to think backwards, and if you have more than one filetype, it will get
more complicated...and what if (as in our real world situation) files of
various and changing file types are being added, and we *only* want to
delete one specific file type. In an automated build situation, we as
developers shouldn't care what other file types other developers are adding
if we *only* want to delete say class files.

I'm a bit puzzled that you mention that your empty dirs seem selected
> by looking at the debug output, yet are not deleted. --DD

No, you're right, they don't seem to be selected, but that's based on
current implementation. However, the debug output only shows the end result,
not the initial matches before includes or excludes (which would also be


Imagination is intelligence having fun...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message