Attached please find a patch that enables util/MergingMapper.java to support multiple target
files.


- it is a small, backwards compatible change
- it makes Mergingpper more powerful and general
- I can use it to implement the <dependset> task (forthcoming)

Thanks ;-)

--Craeg

--
Craeg K. Strong | www.arielpartners.com
Ariel Partners LLC | [EMAIL PROTECTED] 85 River Street, Ste. 3A | Fax: (781) 647-9690
Waltham, MA 02453 | Voice: (781) 647-2425


Index: MergingMapper.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/util/MergingMapper.java,v
retrieving revision 1.2
diff -u -r1.2 MergingMapper.java
--- MergingMapper.java  2001/01/03 14:18:47     1.2
+++ MergingMapper.java  2001/07/11 22:45:06
@@ -56,15 +56,17 @@
 
 /**
  * Implementation of FileNameMapper that always returns the same
- * target file name.
+ * target file name(s).
  *
  * <p>This is the default FileNameMapper for the archiving tasks and
  * uptodate.</p>
  *
+ * <p>target can specify multiple files.</p>
+
  * @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
  */
 public class MergingMapper implements FileNameMapper {
-    protected String[] mergedFile = null;
+    protected String[] mergedFiles = null;
 
     /**
      * Ignored.
@@ -75,14 +77,21 @@
      * Sets the name of the merged file.
      */
     public void setTo(String to) {
-        mergedFile = new String[] {to};
+        mergedFiles = new String[] {to};
+    }
+
+    /**
+     * Sets the name of the merged files.
+     */
+    public void setTo(String[] to) {
+                mergedFiles = to;
     }
 
     /**
-     * Returns an one-element array containing the file name set via setTo.
+     * Returns an array containing the file name(s) set via setTo.
      */
     public String[] mapFileName(String sourceFileName) {
-        return mergedFile;
+        return mergedFiles;
     }
 
 }

Reply via email to