Browse Source

Add pathref attribute to <arg>.

PR: 13137


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273404 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 22 years ago
parent
commit
61bbc457fe
3 changed files with 25 additions and 2 deletions
  1. +3
    -0
      WHATSNEW
  2. +7
    -1
      docs/manual/using.html
  3. +15
    -1
      src/main/org/apache/tools/ant/types/Commandline.java

+ 3
- 0
WHATSNEW View File

@@ -49,6 +49,9 @@ Other changes:

* 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
====================================



+ 7
- 1
docs/manual/using.html View File

@@ -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">a single command-line argument; can contain space
characters.</td>
<td align="center" rowspan="4">Exactly one of these.</td>
<td align="center" rowspan="5">Exactly one of these.</td>
</tr>
<tr>
<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
conventions.</td>
</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>
<td valign="top">line</td>
<td valign="top">a space-delimited list of command-line arguments.</td>


+ 15
- 1
src/main/org/apache/tools/ant/types/Commandline.java View File

@@ -58,6 +58,7 @@ import java.io.File;
import java.util.StringTokenizer;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.ProjectComponent;
import org.apache.tools.ant.util.StringUtils;


@@ -113,7 +114,7 @@ public class Commandline implements Cloneable {
/**
* Used for nested xml command line definitions.
*/
public static class Argument {
public static class Argument extends ProjectComponent {

private String[] parts;

@@ -149,6 +150,19 @@ public class Commandline implements Cloneable {
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
* of the given file.


Loading…
Cancel
Save