ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Haas <>
Subject Proposal: Exec Framework CODE
Date Fri, 07 Apr 2000 23:21:18 GMT
Hi all

Finally the work on a more extensible Exec is mostly done from my part.
I would like you to have a look at it and send me feedback to prepare
this stuff to be included in ANT.


   * Complete sample OExec to replace Exec
   * Move to final package
   * Provide an implemenattaion for the Java task (not ready yet -
     available upon request)
   * The dir option of the Exec task is very dificult to implement
     reliably cross platform, can it be removed?

The framework has been used for the upcomingg JUnit and JavaCC task
during the last 10 days.

The main class Execute spawns processes defined by a command line (list
of Strings).
Input and Output handling can be configured and customized. Two
implementations are currently provided: Redirect to ANT's log and
writing to standard error and output.
In addition a watchdog can be installed, which destroys the spawned
process, if it runs for to long.
A Commandline class is provided to allow defining the process as nested
xml,, whereas each element of the commandline can be specified as a
single element.

OExec shows how to use the classes provided and is meant as base to
replace the existing Exec task.

Thanks to Stefan Bodewig for reviews, feedback and contributions.
The authors of the tasks Java and Exec as alot of their code and ideas
is copied

- tom

FILES (in jakarta-ant/src/main/org/apache/tools/ant)                  Sample using the framework                Main class, spawns processes        Kills processes running for to long  Interfce used to implement stream handlers      Transparantly copies the output of
subprocesses to stdout/err       Sends the output of the subprocess the
ANT's log           Copies an input stream to an output stream        OutputStream sending line by lin to ANT's
log            Helper class used to define command lines

View raw message