Sounds good to me. I think the behaviour is more reasonable overall. If I specify that a file should be excluded, its directory should not be removed, no matter what.

I always found the delete task to be a bit odd.  ;)

Matt.

Gert Driesen wrote:

Hi Matthew,

I've had another look at how our <delete> task is working right now, and the
more I think of it, the more I'm convinced that we should change it to match
the Ant <delete> task.

Right now, we remove all directories that are matched by the fileset. But
this does not respect any excludes.

When you have the following directory structure :

<project base directory>\
        test\
                web.config
                subdir\
                        web.config

And you'd execute the following task :

<delete>
        <fileset basedir=".">
                <include name="test/**/*" />
                <exclude name="test/**/web.config" />
        </fileset>
</delete>

Then the <project base directory>\test\subdir would be completely removed
(although, there's a web.config file in there that should not be deleted),
as that directory is returned in the DirectoryNames collection of the
fileset, and alls path returned in that collection are completely removed by
the <delete> task.

Instead, it might be better to first remove all matching files, and then
remove all matching directories that are empty (and do this only if
"includeemptydirs" is set to true).

What do you think ?

Gert





begin:vcard
fn:Matthew Mastracci
n:Mastracci;Matthew
org:aclaro Softworks, inc.
adr:;;1900a - 11 St. SE;Calgary;Alberta;T2H 3G2;Canada
email;internet:[EMAIL PROTECTED]
title:Software Developer
tel;work:(403) 299-6612
tel;fax:(403) 247-8797
url:http://www.aclaro.com
version:2.1
end:vcard

Reply via email to