Return-Path:
Delivered-To: apmail-ant-dev-archive@www.apache.org
Received: (qmail 18047 invoked from network); 20 Apr 2004 22:32:32 -0000
Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12)
by minotaur-2.apache.org with SMTP; 20 Apr 2004 22:32:32 -0000
Received: (qmail 82660 invoked by uid 500); 20 Apr 2004 22:32:17 -0000
Delivered-To: apmail-ant-dev-archive@ant.apache.org
Received: (qmail 82499 invoked by uid 500); 20 Apr 2004 22:32:16 -0000
Mailing-List: contact dev-help@ant.apache.org; run by ezmlm
Precedence: bulk
List-Unsubscribe:
List-Subscribe:
List-Help:
List-Post:
List-Id: "Ant Developers List"
Reply-To: "Ant Developers List"
Delivered-To: mailing list dev@ant.apache.org
Received: (qmail 82486 invoked by uid 500); 20 Apr 2004 22:32:16 -0000
Received: (qmail 82483 invoked from network); 20 Apr 2004 22:32:16 -0000
Received: from unknown (HELO minotaur.apache.org) (209.237.227.194)
by daedalus.apache.org with SMTP; 20 Apr 2004 22:32:16 -0000
Received: (qmail 18025 invoked by uid 1818); 20 Apr 2004 22:32:29 -0000
Date: 20 Apr 2004 22:32:29 -0000
Message-ID: <20040420223229.18024.qmail@minotaur.apache.org>
From: mbenson@apache.org
To: ant-cvs@apache.org
Subject: cvs commit: ant/docs/manual/CoreTasks pathconvert.html
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N
mbenson 2004/04/20 15:32:29
Modified: . Tag: ANT_16_BRANCH WHATSNEW
src/main/org/apache/tools/ant/taskdefs Tag: ANT_16_BRANCH
PathConvert.java
docs/manual/CoreTasks Tag: ANT_16_BRANCH pathconvert.html
Added: src/etc/testcases/taskdefs Tag: ANT_16_BRANCH
pathconvert.xml
src/testcases/org/apache/tools/ant/taskdefs Tag:
ANT_16_BRANCH PathConvertTest.java
Log:
nested s to 1.6 branch
Revision Changes Path
No revision
No revision
1.1.2.1 +0 -0 ant/src/etc/testcases/taskdefs/pathconvert.xml
Index: pathconvert.xml
===================================================================
RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/pathconvert.xml,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
No revision
No revision
1.1.2.1 +0 -0 ant/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java
Index: PathConvertTest.java
===================================================================
RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/PathConvertTest.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
No revision
No revision
1.503.2.77 +2 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.503.2.76
retrieving revision 1.503.2.77
diff -u -r1.503.2.76 -r1.503.2.77
--- WHATSNEW 20 Apr 2004 22:09:04 -0000 1.503.2.76
+++ WHATSNEW 20 Apr 2004 22:32:28 -0000 1.503.2.77
@@ -87,6 +87,8 @@
* has filelist support.
+* now accepts nested s. Bugzilla Report 26364.
+
Changes from Ant 1.6.0 to Ant 1.6.1
===================================
No revision
No revision
1.27.2.5 +31 -0 ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
Index: PathConvert.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/PathConvert.java,v
retrieving revision 1.27.2.4
retrieving revision 1.27.2.5
diff -u -r1.27.2.4 -r1.27.2.5
--- PathConvert.java 9 Mar 2004 17:01:34 -0000 1.27.2.4
+++ PathConvert.java 20 Apr 2004 22:32:29 -0000 1.27.2.5
@@ -19,6 +19,8 @@
import java.io.File;
import java.util.StringTokenizer;
import java.util.Vector;
+import java.util.List;
+import java.util.ArrayList;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
@@ -29,6 +31,8 @@
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.types.Mapper;
+import org.apache.tools.ant.util.FileNameMapper;
/**
* Converts path and classpath information to a specific target OS
@@ -81,6 +85,9 @@
*/
private String dirSep = null;
+ /** Filename mapper */
+ private Mapper mapper = null;
+
/**
* constructor
*/
@@ -350,6 +357,18 @@
// Get the list of path components in canonical form
String[] elems = path.list();
+ if (mapper != null) {
+ FileNameMapper impl = mapper.getImplementation();
+ List ret = new ArrayList();
+ for (int i = 0; i < elems.length; ++i) {
+ String[] mapped = impl.mapFileName(elems[i]);
+ for (int m = 0; mapped != null && m < mapped.length; ++m) {
+ ret.add(mapped[m]);
+ }
+ }
+ elems = (String[]) ret.toArray(new String[] {});
+ }
+
for (int i = 0; i < elems.length; i++) {
String elem = elems[i];
@@ -433,6 +452,18 @@
return elem;
}
+ /**
+ * Add a mapper to convert the file names.
+ *
+ * @param mapper a Mapper
value
+ */
+ public void addMapper(Mapper mapper) {
+ if (this.mapper != null) {
+ throw new BuildException(
+ "Cannot define more than one mapper");
+ }
+ this.mapper = mapper;
+ }
/**
* Validate that all our parameters have been properly initialized.
No revision
No revision
1.12.2.3 +9 -0 ant/docs/manual/CoreTasks/pathconvert.html
Index: pathconvert.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/pathconvert.html,v
retrieving revision 1.12.2.2
retrieving revision 1.12.2.3
diff -u -r1.12.2.2 -r1.12.2.3
--- pathconvert.html 9 Feb 2004 22:12:07 -0000 1.12.2.2
+++ pathconvert.html 20 Apr 2004 22:32:29 -0000 1.12.2.3
@@ -20,6 +20,10 @@
Nested <map>
elements can be specified to map Windows
drive letters to Unix paths, and vice-versa.
+More complex transformations can be achieved using a nested
+<mapper>
+(since Ant 1.6.2).
+
Parameters
@@ -115,6 +119,11 @@
If the refid
attribute is not specified, then a
nested <path>
element must be supplied. See
Path-like Structures for details.
+mapper
+A single nested
+<mapper>
element can be specified
+to perform any of various filename transformations (since Ant 1.6.2).
+
Examples
In the examples below, assume that the ${wl.home}
property
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org