Browse Source

Merge

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275752 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 21 years ago
parent
commit
49dc6188ed
2 changed files with 45 additions and 41 deletions
  1. +21
    -19
      docs/manual/CoreTasks/exec.html
  2. +24
    -22
      docs/manual/CoreTasks/java.html

+ 21
- 19
docs/manual/CoreTasks/exec.html View File

@@ -14,14 +14,16 @@ the command is only executed when Ant is run on one of the specified operating
systems.</p> systems.</p>


<p>Note that you cannot interact with the forked program, the only way <p>Note that you cannot interact with the forked program, the only way
to send input to it is via the input and inputstring attributes.</p>
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.</p>


<h4>Cygwin Users</h4> <h4>Cygwin Users</h4>
<p>In general the &lt;exec&gt; 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
<p>In general the &lt;exec&gt; 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. Windows executable and is not aware of Cygwin conventions.
</p> </p>
<h4>OpenVMS Users</h4> <h4>OpenVMS Users</h4>
<p>The command specified using <code>executable</code> and <p>The command specified using <code>executable</code> and
<code>&lt;arg&gt;</code> elements is executed exactly as specified <code>&lt;arg&gt;</code> elements is executed exactly as specified
@@ -90,7 +92,7 @@ interpretation of exit codes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">output</td> <td valign="top">output</td>
<td valign="top">Name of a file to which to write the output. If the error stream
<td valign="top">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.</td> is not also redirected to a file or property, it will appear in this output.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
@@ -103,8 +105,8 @@ interpretation of exit codes.</p>
<tr> <tr>
<td valign="top">logError</td> <td valign="top">logError</td>
<td valign="top">This attribute is used when you wish to see error output in Ant's <td valign="top">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 &quot;error&quot; or &quot;errorProperty&quot; redirect error with the &quot;error&quot; or &quot;errorProperty&quot;
attributes, this will have no effect. <em>since Ant 1.6</em></td> attributes, this will have no effect. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
@@ -117,14 +119,14 @@ interpretation of exit codes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">outputproperty</td> <td valign="top">outputproperty</td>
<td valign="top">The name of a property in which the output of the
<td valign="top">The name of a property in which the output of the
command should be stored. Unless the error stream is redirected to a separate command should be stored. Unless the error stream is redirected to a separate
file or stream, this property will include the error output.</td> file or stream, this property will include the error output.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
<tr> <tr>
<td valign="top">errorproperty</td> <td valign="top">errorproperty</td>
<td valign="top">The name of a property in which the standard error of the
<td valign="top">The name of a property in which the standard error of the
command should be stored. <em>since Ant 1.6</em></td> command should be stored. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
@@ -137,14 +139,14 @@ interpretation of exit codes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">inputstring</td> <td valign="top">inputstring</td>
<td valign="top">A string which serves as the input stream for the
<td valign="top">A string which serves as the input stream for the
executed command. This attribute is mutually exclusive with the executed command. This attribute is mutually exclusive with the
input attribute. <em>since Ant 1.6</em></td> input attribute. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
<tr> <tr>
<td valign="top">resultproperty</td> <td valign="top">resultproperty</td>
<td valign="top">the name of a property in which the return code of the
<td valign="top">the name of a property in which the return code of the
command should be stored. Only of interest if failonerror=false.</td> command should be stored. Only of interest if failonerror=false.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
@@ -190,11 +192,11 @@ interpretation of exit codes.</p>
<td valign="top">When this attribute is true, the name of the executable <td valign="top">When this attribute is true, the name of the executable
if resolved firstly against the project basedir and if resolved firstly against the project basedir and
if that does not exist, against the execution 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. <em>since Ant 1.6</em></td> set this to false. <em>since Ant 1.6</em></td>
<td align="center" valign="top">No, default is <i>false</i></td> <td align="center" valign="top">No, default is <i>false</i></td>
</tr>
</tr>
</table> </table>
<h3>Examples</h3> <h3>Examples</h3>
<blockquote> <blockquote>
@@ -241,7 +243,7 @@ system command via nested <code>&lt;env&gt;</code> elements.</p>
</table> </table>


<h3>Errors and return codes</h3> <h3>Errors and return codes</h3>
By default the return code of a &lt;exec&gt; is ignored; when you set
By default the return code of a &lt;exec&gt; is ignored; when you set
<code>failonerror="true"</code> then any return code signaling failure <code>failonerror="true"</code> then any return code signaling failure
(OS specific) causes the build to fail. Alternatively, you can set (OS specific) causes the build to fail. Alternatively, you can set
<code>resultproperty</code> to the name of a property and have it assigned to <code>resultproperty</code> 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; 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. 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, 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.


<h3>Examples</h3> <h3>Examples</h3>
<blockquote><pre> <blockquote><pre>
@@ -286,16 +288,16 @@ system command.</p>
ant process. The browser will let be open.</p> ant process. The browser will let be open.</p>




<p><b>Note:</b> Although it may work for you to specify arguments using
<p><b>Note:</b> 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 simple arg-element and separate them by spaces it may fail if you switch to
a newer version of the JDK. JDK &lt; 1.2 will pass these as separate arguments a newer version of the JDK. JDK &lt; 1.2 will pass these as separate arguments
to the program you are calling, JDK &gt;= 1.2 will pass them as a single
to the program you are calling, JDK &gt;= 1.2 will pass them as a single
argument and cause most calls to fail.</p> argument and cause most calls to fail.</p>
<p><b>Note2:</b> If you are using Ant on Windows and a new DOS-Window pops up <p><b>Note2:</b> 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. 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 &lt; 1.2.</p> This problem may occur with all JDK's &lt; 1.2.</p>
<p> <p>
<b>Timeouts: </b> If a timeout is specified, when it is reached the
<b>Timeouts: </b> If a timeout is specified, when it is reached the
sub process is killed and a message printed to the log. The return 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 value of the execution will be "-1", which will halt the build if
<tt>failonerror=true</tt>, but be ignored otherwise. <tt>failonerror=true</tt>, but be ignored otherwise.


+ 24
- 22
docs/manual/CoreTasks/java.html View File

@@ -16,7 +16,9 @@ If odd things go wrong when you run this task, set fork="true" to use a new
JVM. JVM.


<p>Note that you cannot interact with a forked VM, the only way to <p>Note that you cannot interact with a forked VM, the only way to
send input to it is via the input and inputstring attributes.</p>
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.</p>


<h3>Parameters</h3> <h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0"> <table border="1" cellpadding="2" cellspacing="0">
@@ -32,7 +34,7 @@ send input to it is via the input and inputstring attributes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">jar</td> <td valign="top">jar</td>
<td valign="top">the location of the jar file to execute (must have a
<td valign="top">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.</td> Main-Class entry in the manifest). Fork must be set to true if this option is selected.</td>
<td align="center" valign="top">Either jar or classname</td> <td align="center" valign="top">Either jar or classname</td>
</tr> </tr>
@@ -97,7 +99,7 @@ send input to it is via the input and inputstring attributes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">resultproperty</td> <td valign="top">resultproperty</td>
<td valign="top">The name of a property in which the return code of the
<td valign="top">The name of a property in which the return code of the
command should be stored. Only of interest if failonerror=false command should be stored. Only of interest if failonerror=false
and if fork=true.</td> and if fork=true.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
@@ -110,7 +112,7 @@ send input to it is via the input and inputstring attributes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">output</td> <td valign="top">output</td>
<td valign="top">Name of a file to which to write the output. If the error stream
<td valign="top">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.</td> is not also redirected to a file or property, it will appear in this output.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
@@ -123,8 +125,8 @@ send input to it is via the input and inputstring attributes.</p>
<tr> <tr>
<td valign="top">logError</td> <td valign="top">logError</td>
<td valign="top">This attribute is used when you wish to see error output in Ant's <td valign="top">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 &quot;error&quot; or &quot;errorProperty&quot; redirect error with the &quot;error&quot; or &quot;errorProperty&quot;
attributes, this will have no effect.</td> attributes, this will have no effect.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
@@ -137,14 +139,14 @@ send input to it is via the input and inputstring attributes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">outputproperty</td> <td valign="top">outputproperty</td>
<td valign="top">The name of a property in which the output of the
<td valign="top">The name of a property in which the output of the
command should be stored. Unless the error stream is redirected to a separate command should be stored. Unless the error stream is redirected to a separate
file or stream, this property will include the error output.</td> file or stream, this property will include the error output.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
<tr> <tr>
<td valign="top">errorproperty</td> <td valign="top">errorproperty</td>
<td valign="top">The name of a property in which the standard error of the
<td valign="top">The name of a property in which the standard error of the
command should be stored.</td> command should be stored.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
</tr> </tr>
@@ -157,7 +159,7 @@ send input to it is via the input and inputstring attributes.</p>
</tr> </tr>
<tr> <tr>
<td valign="top">inputstring</td> <td valign="top">inputstring</td>
<td valign="top">A string which serves as the input stream for the
<td valign="top">A string which serves as the input stream for the
executed command. This attribute is mutually exclusive with the executed command. This attribute is mutually exclusive with the
input attribute.</td> input attribute.</td>
<td align="center" valign="top">No</td> <td align="center" valign="top">No</td>
@@ -180,11 +182,11 @@ send input to it is via the input and inputstring attributes.</p>
<h3>Parameters specified as nested elements</h3> <h3>Parameters specified as nested elements</h3>
<h4>arg and jvmarg</h4> <h4>arg and jvmarg</h4>
<p>Use nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code> <p>Use nested <code>&lt;arg&gt;</code> and <code>&lt;jvmarg&gt;</code>
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 <a href="../using.html#arg">Command line arguments</a>.</p> See <a href="../using.html#arg">Command line arguments</a>.</p>
<h4>sysproperty</h4> <h4>sysproperty</h4>
<p>Use nested <code>&lt;sysproperty&gt;</code> <p>Use nested <code>&lt;sysproperty&gt;</code>
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 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 of the class (either ANT's VM or the forked VM). The attributes
for this element are the same as for <a href="exec.html#env">environment for this element are the same as for <a href="exec.html#env">environment
@@ -218,11 +220,11 @@ section about <a href="exec.html#env">exec</a></p>
<p>Settings will be ignored if fork is disabled.</p> <p>Settings will be ignored if fork is disabled.</p>


<h4>permissions</h4> <h4>permissions</h4>
<p>Security permissions can be revoked and granted during the execution of the
<p>Security permissions can be revoked and granted during the execution of the
class via a nested <i>permissions</i> element. For more information please class via a nested <i>permissions</i> element. For more information please
see <a href="../CoreTypes/permissions.html">permissions</a></p> see <a href="../CoreTypes/permissions.html">permissions</a></p>
<p>When the permission RuntimePermission exitVM has not been granted (or has <p>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 <i>failonerror</i>.</p> and treated like indicated in <i>failonerror</i>.</p>
<p><a name="failonerror"/> <p><a name="failonerror"/>
If you specify <code>failonerror=&quot;true&quot;</code> and you do not specify permissions, If you specify <code>failonerror=&quot;true&quot;</code> and you do not specify permissions,
@@ -232,7 +234,7 @@ a non zero return code will lead to a <code>BuildException</code>.
<p>Settings will be ignored if fork is enabled.</p> <p>Settings will be ignored if fork is enabled.</p>


<p><em>since Ant 1.6</em>.</p> <p><em>since Ant 1.6</em>.</p>
<h3>Errors and return codes</h3> <h3>Errors and return codes</h3>
By default the return code of a &lt;java&gt; is ignored. Alternatively, you can set <code>resultproperty</code> to the name By default the return code of a &lt;java&gt; is ignored. Alternatively, you can set <code>resultproperty</code> to the name
of a property and have it assigned to the result code (barring immutability, 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 <code>&lt;java&gt;</code> <b>must</b> return 0 otherwise the build will exit, as the class was run by the build jvm.</p> , then <code>&lt;java&gt;</code> <b>must</b> return 0 otherwise the build will exit, as the class was run by the build jvm.</p>


<h3>Examples</h3> <h3>Examples</h3>
<pre>
<pre>
&lt;java classname=&quot;test.Main&quot;&gt; &lt;java classname=&quot;test.Main&quot;&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt; &lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt; &lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt; &lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
@@ -254,12 +256,12 @@ error and would mean the build exits.
</pre> </pre>
Run a class in this JVM with a new jar on the classpath Run a class in this JVM with a new jar on the classpath


<pre> &lt;java jar=&quot;dist/test.jar&quot;
<pre> &lt;java jar=&quot;dist/test.jar&quot;
fork="true" fork="true"
failonerror="true" failonerror="true"
maxmemory="128m" maxmemory="128m"
&gt; &gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;classpath&gt; &lt;classpath&gt;
&lt;pathelement location=&quot;dist/test.jar&quot;/&gt; &lt;pathelement location=&quot;dist/test.jar&quot;/&gt;
&lt;pathelement path=&quot;${java.class.path}&quot;/&gt; &lt;pathelement path=&quot;${java.class.path}&quot;/&gt;
@@ -267,14 +269,14 @@ Run a class in this JVM with a new jar on the classpath
&lt;/java&gt; &lt;/java&gt;
</pre> </pre>
Run the jar using the manifest supplied entry point, forking (as required), 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.


<pre> &lt;java classname=&quot;test.Main&quot;/&gt;</pre> <pre> &lt;java classname=&quot;test.Main&quot;/&gt;</pre>
<pre> &lt;java classname=&quot;test.Main&quot; <pre> &lt;java classname=&quot;test.Main&quot;
fork=&quot;yes&quot; &gt; fork=&quot;yes&quot; &gt;
&lt;sysproperty key=&quot;DEBUG&quot; value=&quot;true&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;/&gt;
&lt;sysproperty key=&quot;DEBUG&quot; value=&quot;true&quot;/&gt;
&lt;arg value=&quot;-h&quot;/&gt;
&lt;jvmarg value=&quot;-Xrunhprof:cpu=samples,file=log.txt,depth=3&quot;/&gt;
&lt;/java&gt; &lt;/java&gt;
</pre> </pre>
<strong>Note</strong>: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the <strong>Note</strong>: you can not specify the (highly deprecated) MSJVM, "jview.exe" as the


Loading…
Cancel
Save