ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Antonio Pla Rodriguez" <...@procyonsoluciones.com>
Subject return status problem in ant.bat
Date Sat, 17 Feb 2007 07:33:54 GMT
Hello list:

 

 I am programming a java application than execute a shell command and
gets the return status, with this value I can know if the process
success (return status equals 0) or failed (return status not equals 0).

The problem is that every time I run the ant program by a call to
ant.bat I always get cero ( 0 ) as return status, even when the build is
halted explicitly (<fail/>) or when are evident errors ( like a
execution of an inexistent target or an inexistent build.xml ) 

I get this problem in:

 Windows XP SP2

 Apache ant 1.6.5

 I tried version 1.7.0 with seem results

 

Can some one tell me why the ant.bat always returns a status 0
independently of the result of the build process??

There is any way to know if a build process success or fails??

 

This is a snippet of my code:

ProcessBuilder pb = new ProcessBuilder(new String[]{"ant","zzzzzzz"});
//  task zzzzzzz does not exist.

Process p = pb.start();

int r = p.waitFor();   // <------------------------------ this always
returns 0

if ( r == 0 )

   System.out.println("OK");  

else

   System.out.println("FAILED");  

 

 

Regards,

 

Pla.


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message