ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Print message if property unset (or if file doesn't exist)?
Date Mon, 16 Sep 2002 23:13:17 GMT
Welcome back Diane ;-)

Just a reminder, my hack to allow any Task-deriving task to have a nested
<condition> was of course never accepted. Was pretty convenient though! Now
I use ant-contrib instead. --DD

-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com] 
Sent: Monday, September 16, 2002 6:09 PM
To: Ant Users List
Subject: Re: Print message if property unset (or if file doesn't exist)?

--- "Karr, David" <david.karr@attws.com> wrote:
> I just want to print a message if a "build.properties" file does not
> exist in a directory.  I would think this would be an easy thing to do,
> but I don't see a way to do it.  I figured out how to set a property if
> a file is present, but I don't see how to do anything with that.

Do you want it to print the message and keep going, or print the message
and fail?

If the latter, just 'unless' on it in a <fail> task (as of 1.5). If the
former, you'll need to wrap an <echo> in a <target> and 'unless' on the
<target> -- or use the ant-contrib <if> task. (I modified <echo> to allow
for if/unless, but I've not submitted it -- and I think I remember someone
[DD?] putting through something that allowed if/unless on any task, so
that'd probably be the better way to go anyway -- assuming I didn't just
dream it?... ack, been away from all this too long... too much real work,
too little time.)

Diane

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message