ant question about <delete>

A

Andreas Leitgeb

I would like to delete all contents(files&dirs) of a certain directory
except those CVS subdirectories.

My attempts so far:

<delete dir="${build.dir}/classes">
purges the whole folder, without exceptions.

<delete><fileset dir="${build.dir}/classes" excludes="**/CVS"/></delete>
purges only files, leaves empty directory structures behind
(corresponding to the package-structure - not CVS-aware).
Btw.: yes, that "excludes" is redundant, since CVS is already in the
default-excludes.

Is there some <dirset> or <pathset> or is there some extra tag/option for
fileset to also include directories?
I didn't find such in the printed ANT-book.

PS:
It may look weird, why - when using CVS - I'd have an empty CVS-aware
directory in the first place, but that just happens, when there have
been checked-in files there in the past, but no longer nowadays.

I don't think my problem is really CVS-specific. While I could
find CVS-specific solutions for my specific problem, it still
doesn't answer the general question of deleting files and subfolders
while honouring exceptions.
 
Joined
Aug 22, 2008
Messages
6
Reaction score
0
Is there a compelling reason to have the build output classes folder in CVS ?

can the parent folder of the classes be configured with a .cvsignore to just ignore the classes output folder.

To set that up, you would need to cvs delete the classes folder, commit, then update -p to prune the empty folders out, then physically remove the folder from the local workarea, then create a .cvsignore file containing the classes directory in the parent folder of the classes directory.

If there are some artifacts that live in the classes folder that need to be kept in cvs, would it be possible to have them live in another CVS managed folder (i.e. classes-in) and have an ant task copy them over to the real (.cvsignore'd) classes folder,

so then doing the <delete dir="${build.dir}/classes"/> can always just remove everything in that folder.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top