ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist <>
Subject Re: Exiting ant TARGET without aborting build
Date Thu, 17 Mar 2005 18:49:05 GMT

On Mar 17, 2005, at 10:04 AM, Michael Pelz Sherman wrote:

> I'd like to be able to do something like this:
> <target name="foo">
>     <some-task/>
>     <another-task/>
>     <condition property="should.exit">
>         (condition check here....)
>     </condition>
>     <exit if="should.exit" message="some message"/>
>     (do more-tasks...)
> </target>

There's a general pattern that may be in play here... whenever you have 
a target that's starting to look like a program (or a script, if you 
prefer), it may be a sign that you aren't fully grokking the "Ant Way". 
  Try to break it down into sub-targets with the right dependencies 
expressed between them and use the 'if' or 'unless' attribute when you 
need to control whether a target actually executes.


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

View raw message