You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/10/08 00:04:21 UTC
svn commit: r454032 - in /ant/core/trunk: WHATSNEW
docs/manual/CoreTasks/pathconvert.html
src/main/org/apache/tools/ant/taskdefs/PathConvert.java
src/tests/antunit/taskdefs/pathconvert-test.xml
Author: peterreilly
Date: Sat Oct 7 15:04:20 2006
New Revision: 454032
URL: http://svn.apache.org/viewvc?view=rev&rev=454032
Log:
PathConvert on Windows should process forward and back slashes equivalently.
Bugzilla report 32884.
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/CoreTasks/pathconvert.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
ant/core/trunk/src/tests/antunit/taskdefs/pathconvert-test.xml
Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=454032&r1=454031&r2=454032
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Oct 7 15:04:20 2006
@@ -48,6 +48,9 @@
* junit4 did not work with fork=no and junit4 in $ANT_HOME/lib.
Bugzilla report 40697.
+* PathConvert on Windows should process forward and back slashes equivalently.
+ Bugzilla report 32884.
+
Other changes:
--------------
Modified: ant/core/trunk/docs/manual/CoreTasks/pathconvert.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/pathconvert.html?view=diff&rev=454032&r1=454031&r2=454032
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/pathconvert.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/pathconvert.html Sat Oct 7 15:04:20 2006
@@ -107,9 +107,13 @@
</tr>
<tr>
<td valign="top">from</td>
- <td valign="top">The prefix to match. 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.</td>
+ <td valign="top">
+ The prefix to match. 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.
+ <em>Since Ant 1.7.0</em>, on Windows this value is also insensitive
+ to the slash style used for directories, one can use '/' or '\'.
+ </td>
<td valign="top" align="center">Yes</td>
</tr>
<tr>
@@ -197,8 +201,17 @@
then be used in another task, like <tt>javadoc</tt>, that requires a comma separated
list of files.
</p>
-
-
+<h4>Example 4</h4>
+<pre>
+ <pathconvert property="prop" dirsep="|">
+ <map from="${basedir}/abc/" to=''/>
+ <path location="abc/def/ghi"/>
+ </pathconvert>
+</pre>
+ <p>
+ This example sets the property "prop" to "def|ghi" on
+ Windows and on Unix.
+ </p>
</body>
</html>
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/PathConvert.java?view=diff&rev=454032&r1=454031&r2=454032
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/PathConvert.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/PathConvert.java Sat Oct 7 15:04:20 2006
@@ -139,8 +139,11 @@
+ "in a map entry");
}
// If we're on windows, then do the comparison ignoring case
- String cmpElem = onWindows ? elem.toLowerCase() : elem;
- String cmpFrom = onWindows ? from.toLowerCase() : from;
+ // and treat the two directory characters the same
+ String cmpElem =
+ onWindows ? elem.toLowerCase().replace('\\', '/') : elem;
+ String cmpFrom =
+ onWindows ? from.toLowerCase().replace('\\', '/') : from;
// If the element starts with the configured prefix, then
// convert the prefix to the configured 'to' value.
Modified: ant/core/trunk/src/tests/antunit/taskdefs/pathconvert-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/pathconvert-test.xml?view=diff&rev=454032&r1=454031&r2=454032
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/pathconvert-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/pathconvert-test.xml Sat Oct 7 15:04:20 2006
@@ -3,7 +3,7 @@
<target name="test-dir-char">
<pathconvert property="def|ghi" dirsep="|">
<map from="${basedir}/abc/" to=''/>
- <path path="${basedir}/abc/def/ghi"/>
+ <path location="abc/def/ghi"/>
</pathconvert>
<au:assertTrue>
<equals arg1="${def|ghi}" arg2="def|ghi"/>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org