diff --git a/docs/manual/CoreTasks/exec.html b/docs/manual/CoreTasks/exec.html index ed294f7b3..3b233e2f1 100644 --- a/docs/manual/CoreTasks/exec.html +++ b/docs/manual/CoreTasks/exec.html @@ -14,14 +14,16 @@ the command is only executed when Ant is run on one of the specified operating systems.

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

+to send input to it is via the input and inputstring attributes. Also note that +in Ant 1.6, any attempt to read input in the forked program will receive an +EOF (-1). This is a change from Ant 1.5, where such an attempt would block.

Cygwin Users

-

In general the <exec> task will not understand paths such as /bin/sh for -the executable parameter. This is because the Java VM in which Ant is running is a +

In general the <exec> task will not understand paths such as /bin/sh for +the executable parameter. This is because the Java VM in which Ant is running is a Windows executable and is not aware of Cygwin conventions.

- +

OpenVMS Users

The command specified using executable and <arg> elements is executed exactly as specified @@ -90,7 +92,7 @@ interpretation of exit codes.

output - Name of a file to which to write the output. If the error stream + Name of a file to which to write the output. If the error stream is not also redirected to a file or property, it will appear in this output. No @@ -103,8 +105,8 @@ interpretation of exit codes.

logError This attribute is used when you wish to see error output in Ant's - log and you are redirecting output to a file/property. The error - output will not be included in the output file/property. If you + log and you are redirecting output to a file/property. The error + output will not be included in the output file/property. If you redirect error with the "error" or "errorProperty" attributes, this will have no effect. since Ant 1.6 No @@ -117,14 +119,14 @@ interpretation of exit codes.

outputproperty - The name of a property in which the output of the + The name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate file or stream, this property will include the error output. No errorproperty - The name of a property in which the standard error of the + The name of a property in which the standard error of the command should be stored. since Ant 1.6 No @@ -137,14 +139,14 @@ interpretation of exit codes.

inputstring - A string which serves as the input stream for the + A string which serves as the input stream for the executed command. This attribute is mutually exclusive with the input attribute. since Ant 1.6 No resultproperty - the name of a property in which the return code of the + the name of a property in which the return code of the command should be stored. Only of interest if failonerror=false. No @@ -190,11 +192,11 @@ interpretation of exit codes.

When this attribute is true, the name of the executable if resolved firstly against the project basedir and if that does not exist, against the execution - directory if specified. On Unix systems, if you only - want to allow execution of commands in the user's path, + directory if specified. On Unix systems, if you only + want to allow execution of commands in the user's path, set this to false. since Ant 1.6 No, default is false - +

Examples

@@ -241,7 +243,7 @@ system command via nested <env> elements.

Errors and return codes

-By default the return code of a <exec> is ignored; when you set +By default the return code of a <exec> is ignored; when you set failonerror="true" then any return code signaling failure (OS specific) causes the build to fail. Alternatively, you can set resultproperty to the name of a property and have it assigned to @@ -256,7 +258,7 @@ 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. +but some configuration problem on your machine.

Examples

@@ -286,16 +288,16 @@ system command.

ant process. The browser will let be open.

-

Note: Although it may work for you to specify arguments using +

Note: Although it may work for you to specify arguments using a simple arg-element and separate them by spaces it may fail if you switch to a newer version of the JDK. JDK < 1.2 will pass these as separate arguments -to the program you are calling, JDK >= 1.2 will pass them as a single +to the program you are calling, JDK >= 1.2 will pass them as a single argument and cause most calls to fail.

Note2: If you are using Ant on Windows and a new DOS-Window pops up for every command which is executed this may be a problem of the JDK you are using. This problem may occur with all JDK's < 1.2.

-Timeouts: If a timeout is specified, when it is reached the +Timeouts: If a timeout is specified, when it is reached the sub process is killed and a message printed to the log. The return value of the execution will be "-1", which will halt the build if failonerror=true, but be ignored otherwise. diff --git a/docs/manual/CoreTasks/java.html b/docs/manual/CoreTasks/java.html index b12e673ce..5f65dabac 100644 --- a/docs/manual/CoreTasks/java.html +++ b/docs/manual/CoreTasks/java.html @@ -16,7 +16,9 @@ If odd things go wrong when you run this task, set fork="true" to use a new JVM.

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

+send input to it is via the input and inputstring attributes. Also note that +in Ant 1.6, any attempt to read input in the forked VM will receive an +EOF (-1). This is a change from Ant 1.5, where such an attempt would block.

Parameters

@@ -32,7 +34,7 @@ send input to it is via the input and inputstring attributes.

- @@ -97,7 +99,7 @@ send input to it is via the input and inputstring attributes.

- @@ -110,7 +112,7 @@ send input to it is via the input and inputstring attributes.

- @@ -123,8 +125,8 @@ send input to it is via the input and inputstring attributes.

@@ -137,14 +139,14 @@ send input to it is via the input and inputstring attributes.

- - @@ -157,7 +159,7 @@ send input to it is via the input and inputstring attributes.

- @@ -180,11 +182,11 @@ send input to it is via the input and inputstring attributes.

Parameters specified as nested elements

arg and jvmarg

Use nested <arg> and <jvmarg> -elements to specify arguments for the Java class and the forked VM respectively. +elements to specify arguments for the Java class and the forked VM respectively. See Command line arguments.

sysproperty

Use nested <sysproperty> -elements to specify system properties required by the class. +elements to specify system properties required by the class. These properties will be made available to the VM during the execution of the class (either ANT's VM or the forked VM). The attributes for this element are the same as for environment @@ -218,11 +220,11 @@ section about exec

Settings will be ignored if fork is disabled.

permissions

-

Security permissions can be revoked and granted during the execution of the +

Security permissions can be revoked and granted during the execution of the class via a nested permissions element. For more information please see permissions

When the permission RuntimePermission exitVM has not been granted (or has -been revoked) the System.exit() call will be intercepted +been revoked) the System.exit() call will be intercepted and treated like indicated in failonerror.

If you specify failonerror="true" and you do not specify permissions, @@ -232,7 +234,7 @@ a non zero return code will lead to a BuildException.

Settings will be ignored if fork is enabled.

since Ant 1.6.

- +

Errors and return codes

By default the return code of a <java> is ignored. Alternatively, you can set resultproperty to the name of a property and have it assigned to the result code (barring immutability, @@ -243,9 +245,9 @@ error and would mean the build exits. , then <java> must return 0 otherwise the build will exit, as the class was run by the build jvm.

Examples

-
  
+
        <java classname="test.Main">
-         <arg value="-h"/> 
+         <arg value="-h"/>
          <classpath>
            <pathelement location="dist/test.jar"/>
            <pathelement path="${java.class.path}"/>
@@ -254,12 +256,12 @@ error and would mean the build exits.
 
Run a class in this JVM with a new jar on the classpath -
        <java jar="dist/test.jar" 
+
        <java jar="dist/test.jar"
            fork="true"
            failonerror="true"
            maxmemory="128m"
            >
-         <arg value="-h"/> 
+         <arg value="-h"/>
          <classpath>
            <pathelement location="dist/test.jar"/>
            <pathelement path="${java.class.path}"/>
@@ -267,14 +269,14 @@ Run a class in this JVM with a new jar on the classpath
        </java>
 
Run the jar using the manifest supplied entry point, forking (as required), -and with a maximum memory of 128MB. Any non zero return code breaks the build. +and with a maximum memory of 128MB. Any non zero return code breaks the build.
  <java classname="test.Main"/>
  <java classname="test.Main"
         fork="yes" >
-    <sysproperty key="DEBUG" value="true"/> 
-    <arg value="-h"/> 
-    <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/> 
+    <sysproperty key="DEBUG" value="true"/>
+    <arg value="-h"/>
+    <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3"/>
   </java>
 
Note: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the
jarthe location of the jar file to execute (must have a + the location of the jar file to execute (must have a Main-Class entry in the manifest). Fork must be set to true if this option is selected. Either jar or classname
resultpropertyThe name of a property in which the return code of the + The name of a property in which the return code of the command should be stored. Only of interest if failonerror=false and if fork=true. No
outputName of a file to which to write the output. If the error stream + Name of a file to which to write the output. If the error stream is not also redirected to a file or property, it will appear in this output. No
logError This attribute is used when you wish to see error output in Ant's - log and you are redirecting output to a file/property. The error - output will not be included in the output file/property. If you + log and you are redirecting output to a file/property. The error + output will not be included in the output file/property. If you redirect error with the "error" or "errorProperty" attributes, this will have no effect. No
outputpropertyThe name of a property in which the output of the + The name of a property in which the output of the command should be stored. Unless the error stream is redirected to a separate file or stream, this property will include the error output. No
errorpropertyThe name of a property in which the standard error of the + The name of a property in which the standard error of the command should be stored. No
inputstringA string which serves as the input stream for the + A string which serves as the input stream for the executed command. This attribute is mutually exclusive with the input attribute. No