ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Exiting ant TARGET without aborting build
Date Thu, 17 Mar 2005 18:26:09 GMT
Not ideal but you can use the <fail> task with
antcontrib's <try>.

-Matt

--- Michael Pelz Sherman <mpelzsherman@yahoo.com>
wrote:
> Yes, I meant from inside the buildfile. Sorry -
> actually I mean to say
> "target", not "task". 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>
> 
> The "exit" task would simply exit the target, but
> would not abort the entire
> build (assuming "foo" is a child target). Is THIS
> possible?
> 
> - mps
> 
> --- Jan.Materne@rzf.fin-nrw.de wrote:
> > sure, while coding the task you can simply exit
> the execute() method without
> > throwing a BuildException.
> > 
> > mmh or do you mean from inside the buildfile?
> > It cant - a task is an atomic instruction. You
> couldnt stop a
> > System.out.println("test") while 
> > execution.
> > 
> > 
> > Jan
> > 
> > > -----Ursprüngliche Nachricht-----
> > > Von: Michael Pelz Sherman
> [mailto:mpelzsherman@yahoo.com]
> > > Gesendet am: Donnerstag, 17. März 2005 00:50
> > > An: Ant Users List
> > > Betreff: Exiting ant task without aborting build
> > > 
> > > Is there a way to exit an ant task without
> aborting the 
> > > entire build (i.e.
> > > using the <fail> task)?
> > > 
> > > Thanks,
> > > - mps
> > > 
> > >
>
---------------------------------------------------------------------
> > > 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
> 
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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


Mime
View raw message