From b4c9277617ab9ad1d56a9e1f87d5fdeffa07758b Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 11 Apr 2002 06:37:59 +0000 Subject: [PATCH] PR5025 ; doc new attr, bit of text on failure altogether git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272355 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/CoreTasks/exec.html | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docs/manual/CoreTasks/exec.html b/docs/manual/CoreTasks/exec.html index f7b766570..715d7ab6c 100644 --- a/docs/manual/CoreTasks/exec.html +++ b/docs/manual/CoreTasks/exec.html @@ -81,6 +81,11 @@ systems.

No + failifexecutionfails + Stop the build if we can't start the program. + Defaults to true. + No + newenvironment Do not propagate old environment when new environment variables are specified. @@ -141,7 +146,26 @@ system command via nested <env> elements.

replaced by the absolute filename of the file by Ant. -
Examples
+ +

Errors and return codes

+By default the return code of a <exec> is ignored; when you set +failonerror="true" then any non zero response is treated as an +error. Alternatively, you can set resultproperty to the name +of a property and have it assigned to the result code (barring immutability, +of course). +

+If the attempt to start the program fails with an OS dependent error code, +then <exec> halts the build unless failifexecutionfails +is set. You can use that to run a program if it exists, but otherwise +do nothing. +

+What do those error codes mean? Well, they are OS dependent. On Windows +boxes you have to look in include\error.h in your windows compiler or wine files; +error code 2 means 'no such program', which usually means it is not on the path. +Any time you see such an error from any ant task, it is usually not an ant bug, +but some configuration problem on your machine. + +

Examples

 <exec executable="emacs" >
   <env key="DISPLAY" value=":1.0"/>