git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@733729 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -322,6 +322,10 @@ Fixed bugs: | |||||
| miss some files and directories in the presence of recursive | miss some files and directories in the presence of recursive | ||||
| exclude patterns. | exclude patterns. | ||||
| * globmapper didn't work properly if the "to" pattern didn't contain | |||||
| a *. | |||||
| Bugzilla Report 46506. | |||||
| Other changes: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -31,7 +31,7 @@ | |||||
| <target name="testmapper"> | <target name="testmapper"> | ||||
| <pathconvert property="result" dirsep="#"> | <pathconvert property="result" dirsep="#"> | ||||
| <path refid="testpath" /> | <path refid="testpath" /> | ||||
| <mapper type="glob" from="${basedir}" to="test" /> | |||||
| <mapper type="glob" from="${basedir}" to="test*" /> | |||||
| </pathconvert> | </pathconvert> | ||||
| </target> | </target> | ||||
| @@ -68,6 +68,7 @@ public class GlobPatternMapper implements FileNameMapper { | |||||
| // CheckStyle:VisibilityModifier ON | // CheckStyle:VisibilityModifier ON | ||||
| private boolean toContainsStar = false; | |||||
| private boolean handleDirSep = false; | private boolean handleDirSep = false; | ||||
| private boolean caseSensitive = true; | private boolean caseSensitive = true; | ||||
| @@ -126,6 +127,7 @@ public class GlobPatternMapper implements FileNameMapper { | |||||
| } else { | } else { | ||||
| toPrefix = to.substring(0, index); | toPrefix = to.substring(0, index); | ||||
| toPostfix = to.substring(index + 1); | toPostfix = to.substring(index + 1); | ||||
| toContainsStar = true; | |||||
| } | } | ||||
| } else { | } else { | ||||
| throw new BuildException("this mapper requires a 'to' attribute"); | throw new BuildException("this mapper requires a 'to' attribute"); | ||||
| @@ -148,8 +150,10 @@ public class GlobPatternMapper implements FileNameMapper { | |||||
| return null; | return null; | ||||
| } | } | ||||
| return new String[] {toPrefix | return new String[] {toPrefix | ||||
| + extractVariablePart(sourceFileName) | |||||
| + toPostfix}; | |||||
| + (toContainsStar | |||||
| ? extractVariablePart(sourceFileName) | |||||
| + toPostfix | |||||
| : "")}; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -47,7 +47,7 @@ | |||||
| <au:assertFileExists file="${output}/x.jar"/> | <au:assertFileExists file="${output}/x.jar"/> | ||||
| </target> | </target> | ||||
| <target name="xtest-no-*-in-to" depends="setUp" | |||||
| <target name="test-no-*-in-to" depends="setUp" | |||||
| description="https://issues.apache.org/bugzilla/show_bug.cgi?id=46506"> | description="https://issues.apache.org/bugzilla/show_bug.cgi?id=46506"> | ||||
| <touch file="${input}/a-b.jar"/> | <touch file="${input}/a-b.jar"/> | ||||
| <copy todir="${output}"> | <copy todir="${output}"> | ||||
| @@ -58,7 +58,7 @@ | |||||
| <au:assertFileExists file="${output}/c.jar"/> | <au:assertFileExists file="${output}/c.jar"/> | ||||
| </target> | </target> | ||||
| <target name="test-*-at-end-of" depends="setUp"> | |||||
| <target name="test-*-at-end-of-to" depends="setUp"> | |||||
| <touch file="${input}/a-b.jar"/> | <touch file="${input}/a-b.jar"/> | ||||
| <copy todir="${output}"> | <copy todir="${output}"> | ||||
| <fileset dir="${input}"/> | <fileset dir="${input}"/> | ||||