ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: ?? A Clean-Up Task that Always Runs ??
Date Fri, 21 Jun 2002 14:35:31 GMT
A low-cost solution to that problem is to create your own myant script that
calls the normal (unchanged) ant script. You then have the choice of
executing your 'finally' target only when the build succeeds (by appending
your target name to the list of targets), or always (by calling ant a second
time):

---- myant.bat (execute finally on build success only) ----
@echo off
setlocal
ant %* finally

---- myant.bat (execute finally on build success or failure) ----
@echo off
setlocal
ant %*
ant finally

--DD

PS: Bourne/Bash script version left as an exercise to the reader ;-)

-----Original Message-----
From: Lyndon Samson [mailto:samson@ozemail.com.au] 
Sent: Friday, June 21, 2002 12:09 PM
To: Ant Users List
Subject: Re: ?? A Clean-Up Task that Always Runs ??



It's pretty tricky, the easiest way is to change the [.bat|.sh] that
runs ANT to append cleanUp after the list of supplied targets.

Trying to do the same in an ANT script is problematic as Main calls
Project.executeTargets(Vector) but the Vector of targets to call is
not available outside that method.

The Project class does have a fireBuildFinished method which informs
each listener that the build is finished, so maybe you could write a
listener to run an arbitary build file when it gets that message?


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

--
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