ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Ernst <sascha.er...@living-e.com>
Subject AW: exec on batch file causes build to hang
Date Tue, 18 Aug 2009 14:32:18 GMT
Hello,

Perhaps this helps....
       <exec executable="cmd"
         dir="${VCC_CBU_ICdir_root}">
          <arg line="/c start cmd /c
                     &quot;IC_start.bat&quot;" />
       </exec>

This opens a new window, starts your program in this windows and continues
With the build script.
If you change the 2nd /c to /k the buildscripts stops until your program stops and
the windows closes.

BUT: because of the non-existing coupling between the buildscript and the called
program, you cannot use failonerror and stuff like that (shure, you can use it,
but not to monitor/react on the exit code of your program)

The &quot;s are usefull, if you have more complex arg lines.
In your case they are not needed.

Feel free to fiddle around with more or less cmd and start commands....

Ein Gruss von der Saar

--
Sascha Ernst
Dipl. Inform.
Head of Software Quality Management


Telefon: + 49 (0)681 - 302 - 5133
Telefax: + 49 (0)681 - 302 - 5109
E-Mail: sascha.ernst@living-e.com
Website: http://www.living-e.com


Living-e AG 
Campus D3 2
66123 Saarbrücken


Vorstand: Guido Polko
Aufsichtsratsvorsitzender: Uwe Feuersenger
Amtsgericht: Mannheim, HRB 111323

Besuchen Sie uns auf dem 10. ÖV-Symposium am 20.08.2009, Stand 14, Ruhrfestspielhaus, Recklinghausen.



-----Ursprüngliche Nachricht-----
Von: Scott Stark [mailto:sstark@us.ibm.com] 
Gesendet: Dienstag, 18. August 2009 16:16
An: Ant Users List
Betreff: Re: exec on batch file causes build to hang


David Weintraub wrote:
>
> > Can you run the batch file outside of Ant from the command line without
> the
> > process hanging?
>

I've discovered that running "start IC_start.bat" from the command line
opens the process in a new window and returns control to the executing
window (on Windows XP). So this does what I want. However, when I try and
do this from an Ant task, I get this error:

BUILD FAILED
C:\working\informix\stop_restart.xml:98: Execute failed:
java.io.IOException: CreateProcess: start C:\VCC\IC_start.bat error=2

Any idea what "error=2" means, and how I can fix it?

Here's my task FYI:

      <exec executable="start"
                  failonerror="${failonerror}"
                  failifexecutionfails="${failifexecutionfails}"
                  dir="${VCC_CBU_ICdir_root}">
          <arg value="${VCC_CBU_ICdir_root}${file.separator}IC_start.bat"/>
        </exec>

thanks!

Scott

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


Mime
View raw message