You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Mariusz Nowostawski <ma...@marni.otago.ac.nz> on 2000/05/26 00:06:52 UTC

Re: Consolidated delete task

> > Arnout has started a thread about consolidating tasks some days
> > [...]

Task consolidation (delete, deltree and others, I thought it was already
decided ;)
+1

> > Do we keep different attributes for deleting files and dirs, i.e.
> > <delete file="name" /> with no includes or excludes allowed and
> > <delete dir="name" /> with all the MatchingTask stuff in place? I
> > think we should do so to avoid accidents.
> 
> Again, makes sense.

+1

> > Should we set defaultexcludes to false by default when deleting a
> > directory tree - my opinion is yes.
> 
> Agreed.

+1

 
> > Do we need a recurse attribute (don't think so, if you specify a dir,
> > you obviously want to delete it)?
> 
> I think we might. The delete task (at least the "official" one -- I haven't
> tried building from the latest sources) doesn't accept wildcards in the file
> attribute (at least not on NT), so the only way to delete all Java class
> files in a single directory but not its subdirectories would be
> 
>     <delete dir="some/dir" recurse="false" includes="*.class" />

I think

      <delete dir="some/dir" includes="*.class" />

is obviously without recursion and

      <delete dir="some/dir" includes="**/*.class" />

is obviously with recursion. 
What this one would mean if we allow additional tag:

    <delete dir="some/dir" recurse="false" includes="**/*.class" />

?

-1 for a recursion tag, 
include/exclude mechanism is clearer, and is already there.


> > Do we need a purge attribute to delete empty dirs - I'm not decided on
> > this?
> 
> I think so, though it could be set to true by default.

+1 for setting it to true by default 
(but I do not really mind empty dirs to hang around. I want usually to
replace subtrees or files, and general tree structure is always the same,
thus empty dirs somewhere in the tree are all right to me - I do not have
to recreate them when I rebuild. Thus for:

    <delete dir="some/dir" includes="**/*.class" />

I do not really care if the empty dirs will be replaced or not that much.)


regards
Mariusz


RE: Consolidated delete task

Posted by "Arnout J. Kuiper" <aj...@planet.nl>.
At 15:37 26-05-2000 -0400, you wrote:
> > I think
> >
> >       <delete dir="some/dir" includes="*.class" />
> >
> > is obviously without recursion and
> >
> >       <delete dir="some/dir" includes="**/*.class" />
> >
> > is obviously with recursion.
> > What this one would mean if we allow additional tag:
> >
> >     <delete dir="some/dir" recurse="false" includes="**/*.class" />
> >
> > ?
> >
> > -1 for a recursion tag,
> > include/exclude mechanism is clearer, and is already there.
>
>
>That's what I thought at first... but what if I want to recurs/(or not) when
>I have an includes attribute?
>
>- Brill Pappin


includes in itself doesn't automatically imply recursion. You only get
recursion when you specify it in the includes/excludes (with the "**").
See the manual on the includes/excludes mechanism. Therefore the extra
"recurse" attribute is meaningless.

(So a -1 for the recurse attribute;-)

   -Arnout


RE: Consolidated delete task

Posted by Brill Pappin <jo...@jmonkey.com>.
> I think
>
>       <delete dir="some/dir" includes="*.class" />
>
> is obviously without recursion and
>
>       <delete dir="some/dir" includes="**/*.class" />
>
> is obviously with recursion.
> What this one would mean if we allow additional tag:
>
>     <delete dir="some/dir" recurse="false" includes="**/*.class" />
>
> ?
>
> -1 for a recursion tag,
> include/exclude mechanism is clearer, and is already there.


That's what I thought at first... but what if I want to recurs/(or not) when
I have an includes attribute?

- Brill Pappin