ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Scassa <>
Subject RE: deleting a file
Date Mon, 25 Jun 2001 15:46:00 GMT

Is there a way that a stanza or some form of logic can be used to "verify"
that a task has completed successfully. Here is a scenario that I'm living
with; hopefully someone else has had this issue before.

Ant 1.3 -> I have several .xml build scripts, all called by a primary build
script I call AutoBuild.xml. 

Steps (over simplified):
1. This autobuild xml script renames our source directory to source_old
	2. It then creates a new source directory and pulls down the source
from MKS
	3. We then use ANT to build the java files and output to a directory
that consists	
	of a lengthy buildID number. 
	4. Finally, we use ANT to kick-off our installer application
[Install Anywhere 4.0] which 
	packages our product.

Sometimes, the installer application portion is not cleaned up due to
someone accessing it from the network. ANT will fail if someone is accessing
some file under the source directory, but does not fail when a 3rd party
tool throws a warning. 

I'd like to do some file-checking to verify that the files which are
supposed to have been built, were actually done so; for both the class file
output as well as the installer output. Every-so-often, I'll get a previous
installer included with my automated nightly build, none the wiser, until I
get a kickback from QA. Talk about egg on my face.

As of today, I've got ANT deleting three different source destinations in an
effort insure that if it didn't build "today" it won't carry the previous
build material over. This appears to work, but is a weak way to check

Your thoughts?


-----Original Message-----
From: Stefan Bodewig []
Sent: Monday, June 25, 2001 10:13 AM
Subject: Re: deleting a file

Robin Porter <> wrote:

> I currently have a tag in the file I am working on labeled clean
> which will delete a directory for me.  Can I add to the same clean
> tag a command to delete a file in another directory or do I have to
> create another tag all on its own to remove this extra file from
> another directory.

You can give multiple filesets to a single delete task, something
like this

  <fileset dir="my-first-dir" />
  <fileset dir="my-other-dir">
    <include name="my-file" />

is going to remove my-first-dir and my-other-dir/my-file.


View raw message