peterreilly 2004/12/06 11:27:13 Modified: src/main/org/apache/tools/ant/taskdefs Copy.java ExecuteOn.java Expand.java UpToDate.java PathConvert.java src/main/org/apache/tools/ant/taskdefs/optional Native2Ascii.java Log: allow filenamemappers types to be placed directly as a nested element to <copy>, <execon>, <pathconvert>, <uptodate>, unzip,unjar,unwar, <native2ascii> testcases and docs to follow Revision Changes Path 1.76 +11 -1 ant/src/main/org/apache/tools/ant/taskdefs/Copy.java Index: Copy.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Copy.java,v retrieving revision 1.75 retrieving revision 1.76 diff -u -r1.75 -r1.76 --- Copy.java 7 Oct 2004 16:03:51 -0000 1.75 +++ Copy.java 6 Dec 2004 19:27:13 -0000 1.76 @@ -290,6 +290,16 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + createMapper().add(fileNameMapper); + } + + + /** * Sets the character encoding * @param encoding the character encoding * @since 1.32, Ant 1.5 1.58 +10 -0 ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java Index: ExecuteOn.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v retrieving revision 1.57 retrieving revision 1.58 diff -u -r1.57 -r1.58 --- ExecuteOn.java 16 Nov 2004 21:46:46 -0000 1.57 +++ ExecuteOn.java 6 Dec 2004 19:27:13 -0000 1.58 @@ -230,6 +230,16 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + createMapper().add(fileNameMapper); + } + + + /** * @todo using taskName here is brittle, as a user could override it. * this should probably be modified to use the classname instead. */ 1.56 +10 -0 ant/src/main/org/apache/tools/ant/taskdefs/Expand.java Index: Expand.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Expand.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- Expand.java 22 Nov 2004 09:23:27 -0000 1.55 +++ Expand.java 6 Dec 2004 19:27:13 -0000 1.56 @@ -337,6 +337,16 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + createMapper().add(fileNameMapper); + } + + + /** * Sets the encoding to assume for file names and comments. * * <p>Set to <code>native-encoding</code> if you want your 1.37 +9 -0 ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java Index: UpToDate.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/UpToDate.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- UpToDate.java 9 Mar 2004 16:48:06 -0000 1.36 +++ UpToDate.java 6 Dec 2004 19:27:13 -0000 1.37 @@ -117,6 +117,15 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + createMapper().add(fileNameMapper); + } + + /** * Evaluate (all) target and source file(s) to * see if the target(s) is/are up-to-date. */ 1.34 +23 -2 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.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- PathConvert.java 22 Nov 2004 09:23:28 -0000 1.33 +++ PathConvert.java 6 Dec 2004 19:27:13 -0000 1.34 @@ -111,7 +111,7 @@ * Note that this value is case-insensitive when the build is * running on a Windows platform and case-sensitive when running on * a Unix platform. - * @param from + * @param from the prefix string to search for */ public void setFrom(String from) { this.from = from; @@ -169,13 +169,19 @@ * windows", "unix", "netware", and "os/2". */ public static class TargetOs extends EnumeratedAttribute { + /** + * @return the list of values for this enumerated attribute + */ public String[] getValues() { return new String[]{"windows", "unix", "netware", "os/2", "tandem"}; } } - /** Create a nested PATH element */ + /** + * Create a nested PATH element + * @return a Path to be used by ant reflection + */ public Path createPath() { if (isReference()) { @@ -223,6 +229,7 @@ * Set targetos to a platform to one of * "windows", "unix", "netware", or "os/2"; required unless * unless pathsep and/or dirsep are specified. + * @param target the target os * * @since Ant 1.5 */ @@ -254,6 +261,7 @@ /** * The property into which the converted path will be placed. + * @param p the property name */ public void setProperty(String p) { property = p; @@ -263,6 +271,7 @@ /** * Adds a reference to a Path, FileSet, DirSet, or FileList defined * elsewhere. + * @param r the reference to a path, fileset, dirset or filelist */ public void setRefid(Reference r) { if (path != null) { @@ -464,6 +473,18 @@ } this.mapper = mapper; } + + /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + Mapper m = new Mapper(getProject()); + m.add(fileNameMapper); + addMapper(m); + } + /** * Validate that all our parameters have been properly initialized. 1.22 +10 -0 ant/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java Index: Native2Ascii.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Native2Ascii.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Native2Ascii.java 9 Mar 2004 16:48:14 -0000 1.21 +++ Native2Ascii.java 6 Dec 2004 19:27:13 -0000 1.22 @@ -111,6 +111,16 @@ } /** + * A nested filenamemapper + * @param fileNameMapper the mapper to add + * @since Ant 1.6.3 + */ + public void add(FileNameMapper fileNameMapper) { + createMapper().add(fileNameMapper); + } + + + /** * Execute the task * * @throws BuildException is there is a problem in the task execution.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]