Return-Path: Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 33753 invoked by uid 500); 9 Aug 2000 15:50:27 -0000 Delivered-To: apmail-jakarta-ant-cvs@apache.org Received: (qmail 33706 invoked by uid 1146); 9 Aug 2000 15:50:25 -0000 Date: 9 Aug 2000 15:50:25 -0000 Message-ID: <20000809155025.33694.qmail@locus.apache.org> From: bodewig@locus.apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs ExecTask.java Java.java bodewig 00/08/09 08:50:24 Modified: docs index.html junit.html src/main/org/apache/tools/ant/taskdefs ExecTask.java Java.java Log: Documentation for command line arguments (the nested elements for them). Revision Changes Path 1.72 +90 -15 jakarta-ant/docs/index.html Index: index.html =================================================================== RCS file: /home/cvs/jakarta-ant/docs/index.html,v retrieving revision 1.71 retrieving revision 1.72 diff -u -r1.71 -r1.72 --- index.html 2000/08/09 14:59:06 1.71 +++ index.html 2000/08/09 15:50:21 1.72 @@ -441,6 +441,56 @@ <classpath path="${classpath}" /> +

Command line arguments

+ +

Several tasks take arguments that shall be passed to another +process on the command line. To make it easier to specify arguments +that contain space characters, nested elements can be used.

+ + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
valuea single command line argument, can contain space + characters.Exactly one of these.
linea space delimited list of command line arguments.
fileThe name of a file as a single command line + argument. Will be replaced with the absolute filename of the file + by Ant.
pathA string that shall be treated as a PATH like + string as a single command line argument. You can use ; or : as + path separators and Ant will convert it to the platform's local + conventions.
+

Examples

+
  +  <arg value="-l -a" />
  +
+

is a single command line argument containing a space character.

+
  +  <arg line="-l -a" />
  +
+

stands for two separate command line arguments.

+
  +  <arg path="/dir;/dir2:\dir3" />
  +
+

is a single command line argument with value +\dir;\dir2;\dir3 on DOS based systems and +/dir:/dir2:/dir3 on Unix like systems.


Directory based tasks

Some tasks use directory trees for the task they perform. For instance, the command - the command to execute. - Yes + the command to execute with all command line + arguments. deprecated, use executable and nested + <arg> elements instead. + Exactly one of the two. + + + executable + the command to execute without any command line + arguments. dir @@ -1149,6 +1206,12 @@ No + timeout + Stop the command if it doesn't finish within the + specified time (given in milliseconds). + No + + failonerror Stop the buildprocess if the command exits with a returncode other than 0. @@ -1157,11 +1220,15 @@

Examples

-

<exec dir="${src}" command="dir" os="windows" +

<exec dir="${src}" executable="dir" os="windows" output="dir.txt" />

Parameters specified as nested elements

+

arg

+

Command line arguments should be specified as nested +<arg> elements. See Command line arguments.

env

It is possible to specify environment variables to pass to the system command via nested <env> elements.

@@ -1198,7 +1265,7 @@
Examples
  -<exec command="emacs" >
  +<exec executable="emacs" >
     <env key="DISPLAY" value=":1.0" />
   </exec>
   
@@ -1793,7 +1860,9 @@ args - the arguments for the class that is executed. + the arguments for the class that is + executed. deprecated, use nested <arg> + elements instead. No @@ -1817,15 +1886,15 @@ jvmargs - the arguments to pass to the forked VM (ignored if fork is - disabled) + the arguments to pass to the forked VM (ignored + if fork is disabled). deprecated, use nested + <arg> elements instead. No maxmemory Max amount of memory to allocate to the forked VM (ignored if fork is disabled) - all No @@ -1836,12 +1905,18 @@

Parameters specified as nested elements

+

arg and jvmarg

+

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

+

classpath

Java's classpath attribute is a PATH like structure and can also be set via a nested classpath element.

-

Example

+
Example
  
  -       <java classname="test.Main" args="-h" >
  +       <java classname="test.Main" >
  +         <arg value="-h" /> 
            <classpath>
              <pathelement location="\test.jar" />
              <pathelement path="${java.class.path}" />
  @@ -1850,12 +1925,12 @@
   

Examples

  <java classname="test.Main" />
-
  <java classname="test.Main" args="-h" />
  <java classname="test.Main"
  -        args="-h"
  -        fork="yes"
  -        jvmargs="-Xrunhprof:cpu=samples,file=log.txt,depth=3"
  -  />
+ fork="yes" > + <arg value="-h" /> + <jvmarg value="-Xrunhprof:cpu=samples,file=log.txt,depth=3" /> + </java> +

Javac

1.2 +8 -32 jakarta-ant/docs/junit.html Index: junit.html =================================================================== RCS file: /home/cvs/jakarta-ant/docs/junit.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- junit.html 2000/08/09 13:12:12 1.1 +++ junit.html 2000/08/09 15:50:21 1.2 @@ -34,7 +34,7 @@ haltonerror - Stop the build process if an error occures during the test + Stop the build process if an error occurs during the test run. No, default is "off" @@ -85,32 +85,8 @@ would run the test in a VM without JIT.

- - - - - - - - - - - - - - - - - - - - - - - -
AttributeDescriptionRequired
valuea single command line argument.Exactly one of these.
fileThe name of a file as a single command line argument.
pathA string that shall be treated as a PATH - (i.e. the PATH separator will be set according to the plattform's - convention) as a single command line argument.
linea space delimited list of command line arguments.
+

<jvmarg> allows all attributes described in Command line arguments.

formatter

@@ -138,7 +114,7 @@ classname - Name of a custo formatter class. + Name of a custom formatter class. extension @@ -170,7 +146,7 @@ haltonerror - Stop the build process if an error occures during the test + Stop the build process if an error occurs during the test run. Overrides value set in <junit>. No @@ -183,7 +159,7 @@ outfile - Basename of the test result. The full filename is + Base name of the test result. The full filename is determined by this attribute and the extension of formatter. No, default is @@ -228,7 +204,7 @@ haltonerror - Stop the build process if an error occures during the test + Stop the build process if an error occurs during the test run. Overrides value set in <junit>. No @@ -301,7 +277,7 @@

Runs my.test.TestCase in the same VM (ignoring the given CLASSPATH), only a warning is printed if this test fails. In -addition to the plain text testresults, for this test a XML result +addition to the plain text test results, for this test a XML result will be output to result.xml.

For each matching file in the directory ${src.tests} a 1.6 +3 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java Index: ExecTask.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecTask.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- ExecTask.java 2000/08/01 09:18:39 1.5 +++ ExecTask.java 2000/08/09 15:50:23 1.6 @@ -111,6 +111,9 @@ * The full commandline to execute, executable + arguments. */ public void setCommand(Commandline cmdl) { + log("The command attribute is deprecated. " + + "Please use the executable attribute and nested arg elements.", + Project.MSG_WARN); this.cmdl = cmdl; } 1.17 +6 -0 jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java Index: Java.java =================================================================== RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Java.java 2000/08/07 13:58:34 1.16 +++ Java.java 2000/08/09 15:50:23 1.17 @@ -166,6 +166,9 @@ * Set the command line arguments for the class. */ public void setArgs(String s) { + log("The args attribute is deprecated. " + + "Please use nested arg elements.", + Project.MSG_WARN); cmdl.createArgument().setLine(s); } @@ -187,6 +190,9 @@ * Set the command line arguments for the JVM. */ public void setJvmargs(String s) { + log("The args attribute is deprecated. " + + "Please use nested arg elements.", + Project.MSG_WARN); cmdl.createVmArgument().setLine(s); }