ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Clark <robert.cl...@quest.com>
Subject Re: Capture returned value from Java?
Date Thu, 28 Sep 2006 19:35:14 GMT
On Thursday September 28, 2006 15:21, cknell@onebox.com wrote:
> I'm confused about the "outputproperty" attribute of the <java>

> 1) What exactly does the "output of the command" mean? 

Whatever text is passed to System.out.print* (and System.err.print* 
usually, that's the "Unless the error stream is redirected ..." 
clause) in the Java application being run.

> I ask this because I haven't been able to figure a way of getting a
> value returned from a Java class into an Ant property.

If you mean the value passed to System.exit(), you can access this 
using the "resultproperty" property. You will have to set fork=true 
and failonerror=false to have this set though.

Note also that once you deviate from the convention that 0 == success 
and !0 == failure, Ant can no longer determine when you Java program 
actually failed (missing class/jar etc) so you will have figure out 
for yourself if the Java application failed.

See that note at 
<http://ant.apache.org/manual/CoreTasks/java.html#failonerror>

- Rob

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


Mime
View raw message