diff --git a/WHATSNEW b/WHATSNEW
index 3cdc7e1f5..d2618c8d7 100644
--- a/WHATSNEW
+++ b/WHATSNEW
@@ -49,6 +49,9 @@ Other changes:
* OS/400 now gets detected by the os condition.
+* has a new attribute pathref that can be used to reference
+ previously defined paths.
+
Changes from Ant 1.5.1Beta1 to 1.5.1
====================================
diff --git a/docs/manual/using.html b/docs/manual/using.html
index 1a9b93eaf..d4feb7635 100644
--- a/docs/manual/using.html
+++ b/docs/manual/using.html
@@ -429,7 +429,7 @@ that contain space characters, nested arg
elements can be used.
value |
a single command-line argument; can contain space
characters. |
- Exactly one of these. |
+ Exactly one of these. |
file |
@@ -444,6 +444,12 @@ that contain space characters, nested arg
elements can be used.
path separators and Ant will convert it to the platform's local
conventions.
+
+ pathref |
+ Reference to a path
+ defined elsewhere. Ant will convert it to the platform's local
+ conventions. |
+
line |
a space-delimited list of command-line arguments. |
diff --git a/src/main/org/apache/tools/ant/types/Commandline.java b/src/main/org/apache/tools/ant/types/Commandline.java
index c651b17a4..6262e094e 100644
--- a/src/main/org/apache/tools/ant/types/Commandline.java
+++ b/src/main/org/apache/tools/ant/types/Commandline.java
@@ -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.