PR: 13137 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273404 13f79535-47bb-0310-9956-ffa450edef68master
@@ -49,6 +49,9 @@ Other changes: | |||||
* OS/400 now gets detected by the os condition. | * OS/400 now gets detected by the os condition. | ||||
* <arg> has a new attribute pathref that can be used to reference | |||||
previously defined paths. | |||||
Changes from Ant 1.5.1Beta1 to 1.5.1 | Changes from Ant 1.5.1Beta1 to 1.5.1 | ||||
==================================== | ==================================== | ||||
@@ -429,7 +429,7 @@ that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
<td valign="top">value</td> | <td valign="top">value</td> | ||||
<td valign="top">a single command-line argument; can contain space | <td valign="top">a single command-line argument; can contain space | ||||
characters.</td> | characters.</td> | ||||
<td align="center" rowspan="4">Exactly one of these.</td> | |||||
<td align="center" rowspan="5">Exactly one of these.</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">file</td> | <td valign="top">file</td> | ||||
@@ -444,6 +444,12 @@ that contain space characters, nested <code>arg</code> elements can be used.</p> | |||||
path separators and Ant will convert it to the platform's local | path separators and Ant will convert it to the platform's local | ||||
conventions.</td> | conventions.</td> | ||||
</tr> | </tr> | ||||
<tr> | |||||
<td valign="top">pathref</td> | |||||
<td valign="top"><a href="#references">Reference</a> to a path | |||||
defined elsewhere. Ant will convert it to the platform's local | |||||
conventions.</td> | |||||
</tr> | |||||
<tr> | <tr> | ||||
<td valign="top">line</td> | <td valign="top">line</td> | ||||
<td valign="top">a space-delimited list of command-line arguments.</td> | <td valign="top">a space-delimited list of command-line arguments.</td> | ||||
@@ -58,6 +58,7 @@ import java.io.File; | |||||
import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
import java.util.Vector; | import java.util.Vector; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.ProjectComponent; | |||||
import org.apache.tools.ant.util.StringUtils; | import org.apache.tools.ant.util.StringUtils; | ||||
@@ -113,7 +114,7 @@ public class Commandline implements Cloneable { | |||||
/** | /** | ||||
* Used for nested xml command line definitions. | * Used for nested xml command line definitions. | ||||
*/ | */ | ||||
public static class Argument { | |||||
public static class Argument extends ProjectComponent { | |||||
private String[] parts; | private String[] parts; | ||||
@@ -149,6 +150,19 @@ public class Commandline implements Cloneable { | |||||
parts = new String[] {value.toString()}; | parts = new String[] {value.toString()}; | ||||
} | } | ||||
/** | |||||
* Sets a single commandline argument from a reference to a | |||||
* path - ensures the right separator for the local platform | |||||
* is used. | |||||
* | |||||
* @param value a single commandline argument. | |||||
*/ | |||||
public void setPathref(Reference value) { | |||||
Path p = new Path(getProject()); | |||||
p.setRefid(value); | |||||
parts = new String[] {p.toString()}; | |||||
} | |||||
/** | /** | ||||
* Sets a single commandline argument to the absolute filename | * Sets a single commandline argument to the absolute filename | ||||
* of the given file. | * of the given file. | ||||