From 53cdbd10e61543d4863b419c3d6bc9ea383ac824 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 18 Jul 2008 13:09:30 +0000 Subject: [PATCH] some notes on running Ant as a background process. PR 34461. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677899 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/apply.html | 9 +++++++++ docs/manual/CoreTasks/exec.html | 9 +++++++++ docs/manual/CoreTasks/java.html | 10 ++++++++++ docs/manual/running.html | 16 ++++++++++++++++ docs/manual/runninglist.html | 1 + 5 files changed, 45 insertions(+) diff --git a/docs/manual/CoreTasks/apply.html b/docs/manual/CoreTasks/apply.html index 9954950bf..814d9ab6e 100644 --- a/docs/manual/CoreTasks/apply.html +++ b/docs/manual/CoreTasks/apply.html @@ -52,6 +52,15 @@ and you must not specify more than one mapper.

Note that you cannot interact with the forked program, the only way to send input to it is via the input and inputstring attributes.

+

Running Ant as a background process on + Unix(-like) systems

+ +

If you run Ant as a background process (like ant &) + and use the <apply> task with spawn + set to false, you must provide explicit input to the + forked process or Ant will be suspended because it tries to read + from the standard input.

+

Parameters

diff --git a/docs/manual/CoreTasks/exec.html b/docs/manual/CoreTasks/exec.html index 91e9c65bb..e0a9b46b9 100644 --- a/docs/manual/CoreTasks/exec.html +++ b/docs/manual/CoreTasks/exec.html @@ -131,6 +131,15 @@ or the task will fail as follows:

+

Running Ant as a background process on + Unix(-like) systems

+ +

If you run Ant as a background process (like ant &) + and use the <exec> task with spawn + set to false, you must provide explicit input to the + forked process or Ant will be suspended because it tries to read + from the standard input.

+

Parameters

diff --git a/docs/manual/CoreTasks/java.html b/docs/manual/CoreTasks/java.html index cc46d7418..7389729f7 100644 --- a/docs/manual/CoreTasks/java.html +++ b/docs/manual/CoreTasks/java.html @@ -36,6 +36,16 @@ JVM. sending input to it via the input and inputstring attributes.

+

Running Ant as a background process on + Unix(-like) systems

+ +

If you run Ant as a background process (like ant &) + and use the <java> task with spawn + set to false and fork + to true, you must provide explicit input to the forked + process or Ant will be suspended because it tries to read from the + standard input.

+

Parameters

diff --git a/docs/manual/running.html b/docs/manual/running.html index 90c24afaf..59d94ae2c 100644 --- a/docs/manual/running.html +++ b/docs/manual/running.html @@ -520,6 +520,22 @@ shell (of course unless called automatically from ant.cmd). It is t

Scripts envset.cmd and runrc.cmd perform auxiliary tasks. All scripts have some documentation inside.

+

Running Ant as a background process on + Unix(-like) systems

+ +

If you start Ant as a background process (like in ant + &) and the build process creates another process, Ant will + immediately try to read from standard input, which in turn will + most likely suspend the process. In order to avoid this, you must + redirect Ant's standard input or explicitly provide input to each + spawned process via the input related attributes of the + corresponding tasks.

+ +

Tasks that create such new processes + include <exec>, <apply> + or <java> when the fork attribute is + true.

+

Running Ant via Java

If you have installed Ant in the do-it-yourself way, Ant can be started from one of two entry points:

diff --git a/docs/manual/runninglist.html b/docs/manual/runninglist.html index 062d9453f..ae61f2745 100644 --- a/docs/manual/runninglist.html +++ b/docs/manual/runninglist.html @@ -37,6 +37,7 @@ Java System Properties
Cygwin Users
OS/2 Users
+ Running "in the background"
Running Ant via Java