mbenson 2005/02/22 10:26:56 Modified: . WHATSNEW src/etc/testcases/taskdefs pathconvert.xml docs/manual/CoreTasks pathconvert.html src/main/org/apache/tools/ant/taskdefs PathConvert.java src/testcases/org/apache/tools/ant/taskdefs PathConvertTest.java Log: Pathconvert no longer requires that one of (targetos|pathsep|dirsep) be set; platform defaults are used when this is the case. Revision Changes Path 1.753 +3 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.752 retrieving revision 1.753 diff -u -r1.752 -r1.753 --- WHATSNEW 22 Feb 2005 15:30:18 -0000 1.752 +++ WHATSNEW 22 Feb 2005 18:26:56 -0000 1.753 @@ -220,6 +220,9 @@ * Recursive token expansion in a filterset can now be disabled by setting its recurse attribute to false. +* Pathconvert no longer requires that one of (targetos|pathsep|dirsep) + be set; platform defaults are used when this is the case. + Fixed bugs: ----------- 1.2 +4 -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.2 diff -u -r1.1 -r1.2 --- pathconvert.xml 27 Feb 2004 23:23:44 -0000 1.1 +++ pathconvert.xml 22 Feb 2005 18:26:56 -0000 1.2 @@ -18,4 +18,8 @@ </pathconvert> </target> + <target name="testnotargetos"> + <pathconvert property="result" refid="testpath" /> + </target> + </project> 1.16 +3 -6 ant/docs/manual/CoreTasks/pathconvert.html Index: pathconvert.html =================================================================== RCS file: /home/cvs/ant/docs/manual/CoreTasks/pathconvert.html,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- pathconvert.html 12 Mar 2004 17:30:41 -0000 1.15 +++ pathconvert.html 22 Feb 2005 18:26:56 -0000 1.16 @@ -7,7 +7,7 @@ <body> -<h2><a name="foreach">Pathconvert</a></h2> +<h2><a name="pathconvert">Pathconvert</a></h2> <h3>Description</h3> <p>Converts a nested <code><path></code> or reference to a Path, FileSet, DirSet, or FileList into a path @@ -40,10 +40,7 @@ <code>pathsep</code> and <code>dirsep</code> according to the specified target architecture. </td> - <td valign="top" align="center"> - Yes, unless <code>pathsep</code> and/or - <code>dirsep</code> are specified. - </td> + <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">dirsep</td> @@ -185,7 +182,7 @@ </p> <hr> -<p align="center">Copyright © 2001-2004 The Apache Software Foundation. +<p align="center">Copyright © 2001-2005 The Apache Software Foundation. All rights Reserved.</p> </body> </html> 1.40 +2 -8 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.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- PathConvert.java 22 Feb 2005 18:05:48 -0000 1.39 +++ PathConvert.java 22 Feb 2005 18:26:56 -0000 1.40 @@ -190,7 +190,7 @@ /** * Set targetos to a platform to one of * "windows", "unix", "netware", or "os/2"; - * defaults to the current platform. + * current platform settings are used by default. * @deprecated use the method taking a TargetOs argument instead. * @see #setTargetos(PathConvert.TargetOs) */ @@ -203,7 +203,7 @@ /** * Set targetos to a platform to one of * "windows", "unix", "netware", or "os/2"; - * defaults to the current platform. + * current platform settings are used by default. * @param target the target os * * @since Ant 1.5 @@ -437,12 +437,6 @@ if (property == null) { throw new BuildException("You must specify a property"); } - // Must either have a target OS or both a dirSep and pathSep - - if (targetOS == null && pathSep == null && dirSep == null) { - throw new BuildException("You must specify at least one of " - + "targetOS, dirSep, or pathSep"); - } // Determine the separator strings. The dirsep and pathsep attributes // override the targetOS settings. String dsep = File.separator; 1.2 +5 -1 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.2 diff -u -r1.1 -r1.2 --- PathConvertTest.java 27 Feb 2004 23:23:44 -0000 1.1 +++ PathConvertTest.java 22 Feb 2005 18:26:56 -0000 1.2 @@ -1,5 +1,5 @@ /* - * Copyright 2004 The Apache Software Foundation. + * Copyright 2004-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,6 +43,10 @@ test("testmapper"); } + public void testNoTargetOs() { + executeTarget("testnotargetos"); + } + private void test(String target) { executeTarget(target); assertPropertyEquals("result", "test#" + BUILD_FILENAME);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]