cvs commit: ant/docs/manual/CoreTasks pathconvert.html
mbenson 2005/05/23 14:12:59 Modified:docs/manual/CoreTasks pathconvert.html Log: Document pathconvert changes. Revision ChangesPath 1.19 +11 -11ant/docs/manual/CoreTasks/pathconvert.html Index: pathconvert.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/pathconvert.html,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- pathconvert.html 29 Apr 2005 18:58:13 - 1.18 +++ pathconvert.html 23 May 2005 21:12:59 - 1.19 @@ -10,12 +10,12 @@ h2a name=pathconvertPathconvert/a/h2 h3Description/h3 -pConverts a nested codelt;pathgt;/code or reference to a Path, -FileSet, DirSet, or FileList into a path -form for a particular platform, and stores the result in a given property. -It can also be used when you need -to convert a Path, FileSet, or DirSet into a list, separated by a given -character, such as a comma or space, or, conversely, to convert a list +pConverts a nested a href=../CoreTypes/resources.html#collection +ResourceCollection/a, or a reference to one, into a path +form for a particular platform, optionally storing the result into +a given property. It can also be used when you need +to convert a Resource Collection into a list, separated by a given +character, such as a comma or space, or, conversely, e.g. to convert a list of files in a FileList into a path. /p pNested codelt;mapgt;/code elements can be specified to map Windows @@ -62,7 +62,7 @@ tr td valign=topproperty/td td valign=topThe name of the property in which to place the converted path./td -td valign=top align=centerYes/td +td valign=top align=centerNo, result will be logged if unset/td /tr tr td valign=toprefid/td @@ -112,10 +112,10 @@ your map elements can be important, if any codefrom/code values are prefixes of other codefrom/code values./i /p -h4path/h4 -pIf the coderefid/code attribute is not specified, then a - nested codelt;pathgt;/code element must be supplied. See - a href=../using.html#pathPath-like Structures/a for details./p +h4Resource Collections/h4 +pIf the coderefid/code attribute is not specified, then one or more + nested a href=../CoreTypes/resources.html#collectionResource +Collection/as must be supplied./p h4mapper/h4 pA single nested a href=../CoreTypes/mapper.html codelt;mappergt;/code/a element can be specified - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: ant/docs/manual/CoreTasks pathconvert.html
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: pathconvert nested mappers to 1.6 branch Revision ChangesPath 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 - 1.503.2.76 +++ WHATSNEW 20 Apr 2004 22:32:28 - 1.503.2.77 @@ -87,6 +87,8 @@ * touch has filelist support. +* pathconvert now accepts nested mappers. 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 - 1.27.2.4 +++ PathConvert.java 20 Apr 2004 22:32:29 - 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 codeMapper/code 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 ===
cvs commit: ant/docs/manual/CoreTasks pathconvert.html
bodewig 2003/03/20 01:14:41 Modified:docs/manual/CoreTasks pathconvert.html Log: Typo Revision ChangesPath 1.12 +1 -1 ant/docs/manual/CoreTasks/pathconvert.html Index: pathconvert.html === RCS file: /home/cvs/ant/docs/manual/CoreTasks/pathconvert.html,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- pathconvert.html 14 Mar 2003 16:01:03 - 1.11 +++ pathconvert.html 20 Mar 2003 09:14:41 - 1.12 @@ -67,7 +67,7 @@ td valign=topWhat to convert, given as a a href=../using.html#referencesreference/a to a codelt;pathgt;/code, codelt;filesetgt;/code, -codelt;dirsetgt;/code, or codelt;filesetgt;/code +codelt;dirsetgt;/code, or codelt;filelistgt;/code defined elsewhere/td td valign=top align=centerNo; if omitted, a nested codelt;pathgt;/code element must be supplied./td