ant-user mailing list archives

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

The http://www.antxtras.info/ package supports this also. Use 
something like: 

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

          <always>
              [backup my stuff...]
          </always>
      </protect>
   </target>

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

- The Wabbit


----- Original Message -----
From: "Leonardo Abreu de Barros" <leobarros@email.com>
Date: Mon, 15 Sep 2003 14:23:31 -0000
To: ant-user@jakarta.apache.org
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 Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers


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


Mime
View raw message