ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r733729 - in /ant/core/trunk: WHATSNEW src/etc/testcases/taskdefs/pathconvert.xml src/main/org/apache/tools/ant/util/GlobPatternMapper.java src/tests/antunit/types/glob-test.xml
Date Mon, 12 Jan 2009 13:18:41 GMT
Author: bodewig
Date: Mon Jan 12 05:18:38 2009
New Revision: 733729

URL: http://svn.apache.org/viewvc?rev=733729&view=rev
Log:
don't automatically assume a to pattern contains a * in globmapper.  PR 46506.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/testcases/taskdefs/pathconvert.xml
    ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
    ant/core/trunk/src/tests/antunit/types/glob-test.xml

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=733729&r1=733728&r2=733729&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Jan 12 05:18:38 2009
@@ -322,6 +322,10 @@
    miss some files and directories in the presence of recursive
    exclude patterns.
 
+ * globmapper didn't work properly if the "to" pattern didn't contain
+   a *.
+   Bugzilla Report 46506.
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/etc/testcases/taskdefs/pathconvert.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/pathconvert.xml?rev=733729&r1=733728&r2=733729&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/pathconvert.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/pathconvert.xml Mon Jan 12 05:18:38 2009
@@ -31,7 +31,7 @@
     <target name="testmapper">
         <pathconvert property="result" dirsep="#">
             <path refid="testpath" />
-            <mapper type="glob" from="${basedir}" to="test" />
+            <mapper type="glob" from="${basedir}" to="test*" />
         </pathconvert>
     </target>
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java?rev=733729&r1=733728&r2=733729&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/util/GlobPatternMapper.java Mon Jan 12 05:18:38
2009
@@ -68,6 +68,7 @@
 
     // CheckStyle:VisibilityModifier ON
 
+    private boolean toContainsStar = false;
     private boolean handleDirSep = false;
     private boolean caseSensitive = true;
 
@@ -126,6 +127,7 @@
             } else {
                 toPrefix = to.substring(0, index);
                 toPostfix = to.substring(index + 1);
+                toContainsStar = true;
             }
         } else {
             throw new BuildException("this mapper requires a 'to' attribute");
@@ -148,8 +150,10 @@
             return null;
         }
         return new String[] {toPrefix
-                                 + extractVariablePart(sourceFileName)
-                                 + toPostfix};
+                             + (toContainsStar
+                                ? extractVariablePart(sourceFileName)
+                                  + toPostfix
+                                : "")};
     }
 
     /**

Modified: ant/core/trunk/src/tests/antunit/types/glob-test.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/types/glob-test.xml?rev=733729&r1=733728&r2=733729&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/types/glob-test.xml (original)
+++ ant/core/trunk/src/tests/antunit/types/glob-test.xml Mon Jan 12 05:18:38 2009
@@ -47,7 +47,7 @@
     <au:assertFileExists file="${output}/x.jar"/>
   </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">
     <touch file="${input}/a-b.jar"/>
     <copy todir="${output}">
@@ -58,7 +58,7 @@
     <au:assertFileExists file="${output}/c.jar"/>
   </target>
 
-  <target name="test-*-at-end-of" depends="setUp">
+  <target name="test-*-at-end-of-to" depends="setUp">
     <touch file="${input}/a-b.jar"/>
     <copy todir="${output}">
       <fileset dir="${input}"/>



Mime
View raw message