ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <stev...@iseran.com>
Subject Re: Task "exec" with attribute "output"
Date Mon, 18 Aug 2003 18:51:02 GMT
Morten Mortensen wrote:
> Hi all,
> 
> I experience some funny stuff with the "exec" task, when I set the "output"
> attribute. It very much appears to me as if the output-stream does not get
> flushed. Tried 1.5.3 and some 1.6's.
> 
> (I continue to have little luck with searching the bug-database; keep
> getting lists a numbers out - probably a user-error - ...)
> 
> I suspect, that there is a "Runtime.exec()" hidden in there somewhere below
> the "ExecTask". 

yup

And some "Process.getOutputStream()".

Maybe in ExecuteStreamHandler

> Instead I find lots of
> OS-specific stuff (like direct invocation of "cmd.exe" instead of JNI with
> ::ShellExecuteEx() - well, fair enough!).

Well, we dont use non-standard JNI calls as that would need ant to build 
and run custom DLLS/shared libs. And I wouldnt use ::ShellExecuteEx() in 
that case anyway, because, well, its the wrong way to start command line 
programs in Win32.


> Where do I find the "Runtime.exec()" triggered by "ExecTask.execute()"?
> I would like to have a closer look.

Execute.java

There are custom inner classes to handle exec on different platforms 
*and* different Java runtimes. So that runtime.exec you seek is in 
there, maybe loaded via reflection.

> 
> Have you ever discussed using a "SplitOutputStream" to have output from
> "exec" guided to both a file and Ant-std-out at the same time - to see
> progress while still preserving the information in a file - ? -Or a more
> generic mechanism attached to Ant-std-out with tasks like "split-begin" and
> "split-end"?

You mean a more generic Unix style pipe architecture, dont you?

<exec something> | <grep > | <mail steve> ...

Its been thought about; Filterchains do it for transformations to files, 
but not for generic execution & output processing...you need to use 
intermediary files there

> 
> Hope one of you care to answer. :-)
> 
> Regards,
>   Morten Sabroe Mortensen
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 



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


Mime
View raw message