You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Yung Choi <ch...@bea.com> on 2004/04/06 16:32:08 UTC

Repost - why ant doesn't exit when a script exits on windows?

Should ant exit when it's executable script exit?
If it does not, is it a ant bug?
The followings is with ant 1.6.1:

A simple ant test file antTest.xml like this:

======================================================
<project name="test" default="test">
<target name="test">
   <exec executable="sh" failonerror="true">
     <arg value="-c"/>
     <arg value="startTest.sh"/>
   </exec>
</target>
</project>
======================================================

startTest.sh looks (using this with UNIX, make sure chmod +x
startTest.sh):

======================================================
#! /bin/ksh

date

sleep 60 > /dev/null 2>&1 &

date

exit 0
======================================================

ant -f antTest.xml

I believe that this antTest.xml should complete as soon as
the startTest.sh hits exit 0.
It does as I expect for Solaris, but not for windows.

So could I enter a bug report for this?
If so, where and how?

Thanks for any help,		- yung


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


Re: Repost - why ant doesn't exit when a script exits on windows?

Posted by "Alexey N. Solofnenko" <A....@mdl.com>.
I think it is a Java behaviour. Once I tried starting new programs with 
JNI and closed hProcess right after the process started and amazingly I 
did not have any problems with buffer overflows and exit blocking. 
Unfortunately there is no way in Java itself to close the process handle.

- Alexey.

Yung Choi wrote:

>Should ant exit when it's executable script exit?
>If it does not, is it a ant bug?
>The followings is with ant 1.6.1:
>
>A simple ant test file antTest.xml like this:
>
>======================================================
><project name="test" default="test">
><target name="test">
>   <exec executable="sh" failonerror="true">
>     <arg value="-c"/>
>     <arg value="startTest.sh"/>
>   </exec>
></target>
></project>
>======================================================
>
>startTest.sh looks (using this with UNIX, make sure chmod +x
>startTest.sh):
>
>======================================================
>#! /bin/ksh
>
>date
>
>sleep 60 > /dev/null 2>&1 &
>
>date
>
>exit 0
>======================================================
>
>ant -f antTest.xml
>
>I believe that this antTest.xml should complete as soon as
>the startTest.sh hits exit 0.
>It does as I expect for Solaris, but not for windows.
>
>So could I enter a bug report for this?
>If so, where and how?
>
>Thanks for any help,		- yung
>
>
>---------------------------------------------------------------------
>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