ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wascally Wabbit" <>
Subject Re: FINALLY target?
Date Mon, 15 Sep 2003 23:47:42 GMT

The package supports this also. Use 
something like: 

   <target name="Whatever" ...>
          [stuff that might die...]

              [backup my stuff...]

Also you can use the <iferror> task to do stuff in response to
an exception.

- The Wabbit

----- Original Message -----
From: "Leonardo Abreu de Barros" <>
Date: Mon, 15 Sep 2003 14:23:31 -0000
Subject: FINALLY target?

> Hi all,
> Hope you can help me. I'm running a suite of tests on directories with
> real data so I need to backup all this data before I start the tests.
> This is done using a target "backup". As soon as all tests get done, I
> call another target that restores the original data. 
> The problem is, when something goes wrong, the build fails and the
> data isn't restored. 
> Is there a way to always guarantee that this target will be called?
> What I'm looking for is something similar to the "FINALLY" keyword in
> Java, applied to the concept of Ant builds.
> Any idea how to accomplish this?
> Thanks in advance,
> Leonardo Barros

Sign-up for your own personalized E-mail at has over 400,000 jobs. Be smarter about your job search

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message