ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Pelz Sherman <mpelzsher...@yahoo.com>
Subject Re: Exiting ant TARGET without aborting build
Date Thu, 17 Mar 2005 19:55:59 GMT
Yeah, yeah, I know. :-)

Mostly, I was just curious if such a thing were possible. But I think there is
a good argument to be made for this kind of task. After all, if one has to
break up a functionally "atomic" target into a whole bunch of sub-targets which
will never be re-used, that's a lot more work and organizational overhead. If I
truly need this capability (and I suspect I will), I'll definitely take a look
at the <trycatch> task in ant-contrib.

- mps

--- Mark Lundquist <mlundquist2@comcast.net> wrote:
> 
> 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.
> 
> —ml—
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

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


Mime
View raw message