ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@apache.org>
Subject Re: Problems with the exec task
Date Sun, 15 Feb 2004 17:31:10 GMT
Anthony Goubard wrote:

>Hi,
>
>There are 2 problems described in this mail :
> - Executing a command freezes when javaw is used
> - Executing an application that is still running after System.exit()
>My configuration is Windows ME, ANT 1.6.0, Java 1.4.2
>
>Problem 1 :
> I want to execute a command (for example dir) using ANT and get the output
>to display it in a textarea.
> It works when I use java but not when I use javaw.
> I've done some debugging and notice that it stops at the
>PumpStreamHandler.stop() method.
> I think that it's a problem with outputThread.join(); or
>inputThread.join();
> Is it a bug?
> Does anyone know how to execte a command line in a graphical environment?
>  
>
I do not have any special idea concerning executing a command line in a 
graphical environment.
Note that to execute dir, you really have to execute cmd /c dir
because dir is an *internal* DOS command.
Which means in ant terms something like :
<exec executable="cmd.exe">
    <arg value="/C"/>
     <arg value="dir"/>
      <arg value="...some other arg"/>
</exec>

>Problem 2 :
> I'd like to create a task that execute an application (for example WinAmp).
> I used <parallel timeout="1000"> so that ANT continues and finishes the
>target without waiting the application to quit.
> The problem is application who launched the ANT script exit the application
>launched also exit.
> I think this is due to the waitFor() in Execute. Is there a way to avoid
>it?
>
>  
>
In ant 1.6,  the <java/> and the <exec/> task have a spawn attribute for 
programs which should run in background.

Cheers,

Antoine


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


Mime
View raw message