You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Truesdale, Jay" <JT...@erac.com> on 2002/04/17 19:30:15 UTC

Delete did not fail

I am using ant 1.4.1.

I have this in build.xml:

<delete failonerror="true" quiet="false" verbose="true"
file="${root_dir}/${release_version}/wlconf.${prod_mach_1}/cluster${nosi_web
logic_port}/conf/DB2DataSync.properties" />

If one of the properties (say ${release_version}) is not defined then I
would expect the delete task to fail since the file does not exist. It
doesn't and the Ant build continues along its merry way.

Am I missing something?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Delete did not fail

Posted by Diane Holt <ho...@yahoo.com>.
--- "Truesdale, Jay" <JT...@erac.com> wrote:
> I have this in build.xml:
> 
> <delete failonerror="true" quiet="false" verbose="true"
>
file="${root_dir}/${release_version}/wlconf.${prod_mach_1}/cluster${nosi_web
> logic_port}/conf/DB2DataSync.properties" />
> 
> If one of the properties (say ${release_version}) is not defined then I
> would expect the delete task to fail since the file does not exist. It
> doesn't and the Ant build continues along its merry way.
> 
> Am I missing something?

The <delete> task doesn't consider not finding the specified file an error
-- afterall, if you're deleting a file that doesn't exist, it's a push :) 
The only time an error comes into it is if the process of actually
deleting a file that does exist fails.

What you probably want to do, if verifying that your required properties
are set is your actual goal here, is to have a <condition> block that does
just that, with a <fail> if any required ones aren't set. In 1.5alpha
(soon to go beta), there's an <isset> condition -- for 1.4(.1), you'd need
to use the <equals> condition, testing for, eg., "$${release.version}".

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>