ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Sugnet <j...@lutris.com>
Subject Re: removing directories
Date Tue, 23 Jan 2001 19:58:04 GMT
Nico,
    thank you for the clarification, but I dont think I was clear enough in my
original post on what I am trying to do.   Abetter examples is the following.
Suppose I have a directory named src in which I have a large source module
checked out from a CVS repository.  At every directory level in the src
directory tree, there is a CVS directory.  In shell, removing all these CVS
direcoties from the source tree without removing any of the source files and
directories can be done easily by doing a find and piping it to rm, something
like `find src -name "CVS"|xargs rm -rf`.    The src module is left behind
intact, only all of the CVS directories are removed.  What is the best way to
do this same operation in ant?  It seems like the fileset element only allows
you to specify patterns of files and not directories.   Any info is
apprecieated.

thanks,
josh

Nico Seessle wrote:

> ----- Original Message -----
> From: "Josh Sugnet" <josh@lutris.com>
> To: <ant-user@jakarta.apache.org>
> Sent: Tuesday, January 23, 2001 3:47 AM
> Subject: removing directories
>
> > I am trying to recursively remove all of the classes directories from a
> directory
> > tree, but am not having much luck.  I am trying the following:
> >
> > <delete>
> >      <fileset dir="test" includes="**/classes" />
> >  </delete>
> >
>
> Think of delete as having two "modes" of operation:
>
> 1. Delete files - is activated if you specifiy file as you do implicitely
> with the fileset
> 2. Delete directory - if *only* dir="..." is specified.
>
> Change your task to
>
> <delete dir="test"/>
> or
> <delete dir="test/classes"/>
>
> and it should work (I'm not really sure what you wish to delete - the first
> one will delete everything under test, the second one everything unter
> test/classes).
>
> Nico


Mime
View raw message