You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ben Ryan <b....@kainao.com> on 2005/10/28 13:49:33 UTC

Logging depending on return result from Java prog

Hi,
    Apologies in advance if this is a trivial question.
 
    I have looked everywhere I can find, there are probably lots of
other places, for an example of how to log an error message only when
the prog run by a java task returns non-zero.
    Can anybody help? 
 
Regards,
    Ben

------------------------------------------
Dr Ben Ryan MBCS
Technical Director
Kainao Limited
Tel (Direct): +44 1484 453306
Tel (General): +44 1484 453303
Fax: +44 1484 453343
Web: http://www.kainao.com <http://www.kainao.com/> 
------------------------------------------


 

Re: Logging depending on return result from Java prog

Posted by James Abley <ja...@volantis.com>.
On Fri, 2005-10-28 at 12:49, Ben Ryan wrote:
> Hi,
>     Apologies in advance if this is a trivial question.
>  
>     I have looked everywhere I can find, there are probably lots of
> other places, for an example of how to log an error message only when
> the prog run by a java task returns non-zero.
>     Can anybody help? 
>  
> Regards,
>     Ben
> 
> ------------------------------------------
> Dr Ben Ryan MBCS
> Technical Director
> Kainao Limited
> Tel (Direct): +44 1484 453306
> Tel (General): +44 1484 453303
> Fax: +44 1484 453343
> Web: http://www.kainao.com
> ------------------------------------------

I'd suggest using the resultproperty attribute of the java task, and
then a condition which sets a property when the resultproperty is not
equal to "0".

Targets can then run using unless or if which can fail or echo the
message as you require.

James

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