ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Haas <thomas.h...@softwired-inc.com>
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.

TODO:

   * Complete sample OExec to replace Exec
   * Move to final package org.apache.tools.ant
   * 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?

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


DESCRIPTION
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.


ACKNOWLEDGE
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)

OExec.java:                  Sample using the framework
Execute.java:                Main class, spawns processes
ExecuteWatchdog.java:        Kills processes running for to long
ExecuteStreamHanndler.java:  Interfce used to implement stream handlers
PumpStreamHandler.java:      Transparantly copies the output of
subprocesses to stdout/err
LogStreamHandler.java:       Sends the output of the subprocess the
ANT's log
StreamPumper.java:           Copies an input stream to an output stream
LogOutputStream.java:        OutputStream sending line by lin to ANT's
log
Commandline.java:            Helper class used to define command lines


Mime
View raw message