git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1351053 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -37,6 +37,10 @@ Fixed bugs: | |||||
| * ExtensionPoint doesn't work with nested import/include | * ExtensionPoint doesn't work with nested import/include | ||||
| Bugzilla Report 53405. | Bugzilla Report 53405. | ||||
| * <packagemapper> failed to strip the non-matched parts with | |||||
| handledirsep="true". | |||||
| Bugzilla Report 53399. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -41,7 +41,7 @@ public class PackageNameMapper extends GlobPatternMapper { | |||||
| String var = name.substring(prefixLength, | String var = name.substring(prefixLength, | ||||
| name.length() - postfixLength); | name.length() - postfixLength); | ||||
| if (getHandleDirSep()) { | if (getHandleDirSep()) { | ||||
| var = name.replace('/', '.').replace('\\', '.'); | |||||
| var = var.replace('/', '.').replace('\\', '.'); | |||||
| } | } | ||||
| return var.replace(File.separatorChar, '.'); | return var.replace(File.separatorChar, '.'); | ||||
| } | } | ||||
| @@ -31,6 +31,20 @@ | |||||
| <string>foo\bar</string> | <string>foo\bar</string> | ||||
| <packagemapper from="*" to="*" handledirsep="true"/> | <packagemapper from="*" to="*" handledirsep="true"/> | ||||
| </pathconvert> | </pathconvert> | ||||
| <au:assertPropertyEquals name="p2" value="foo.bar"/> | |||||
| </target> | |||||
| <target name="testMapsOnlySubstring" | |||||
| description="https://issues.apache.org/bugzilla/show_bug.cgi?id=53399"> | |||||
| <pathconvert property="p1"> | |||||
| <string>xyzzy${file.separator}foo${file.separator}bar</string> | |||||
| <packagemapper from="xyzzy/*" to="*" handledirsep="false"/> | |||||
| </pathconvert> | |||||
| <au:assertPropertyEquals name="p1" value="foo.bar"/> | <au:assertPropertyEquals name="p1" value="foo.bar"/> | ||||
| <pathconvert property="p2"> | |||||
| <string>xyzzy${file.separator}foo${file.separator}bar</string> | |||||
| <packagemapper from="xyzzy/*" to="*" handledirsep="true"/> | |||||
| </pathconvert> | |||||
| <au:assertPropertyEquals name="p2" value="foo.bar"/> | |||||
| </target> | </target> | ||||
| </project> | </project> | ||||