ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 26364] - <pathconvert> should support nested <mapper>s in addition to its <map> element
Date Thu, 29 Jan 2004 15:20:29 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26364>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26364

<pathconvert> should support nested <mapper>s in addition to its <map> element

peter.reilly@corvil.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[PATCH] nested <mapper> for |<pathconvert> should support
                   |<pathconvert> PLUS composite|nested <mapper>s in addition
                   |<mapper>                    |to its <map> element



------- Additional Comments From peter.reilly@corvil.com  2004-01-29 15:20 -------
Hi Matt, I worked on an enhancement to mapper last
year that I did not release (I lost it ;-).
It is like your composite
mapper except that it uses the add(FileNameName) method
signature and allows the filename mappers to be chained
or to be treated in parallel:
    <delete quiet="yes" dir="mapper.test"/>
    <mkdir dir="mapper.test"/>
    <touch file="mapper.test/1.test"/>
    <touch file="mapper.test/y.java"/>
    <path id="x">
      <fileset dir="mapper.test"/>
    </path>
    <reflectdef name="basenamemapper" language="beanshell">
      package my.mappers;
      import java.io.*;
      import org.apache.tools.ant.util.FileNameMapper;
      public class upcasemapper implements FileNameMapper {
          public void setFrom(String ignore) {}
          public void setTo(String ignore) {}
          public String[] mapFileName(String filename) {
              File x = new File(filename);
              return new String[] {x.getName()};
          }
      }
    </reflectdef>
    <pathconvert refid="x" targetos="unix" property="p">
      <mapper chained="yes">
        <mapper>
          <globmapper from="*.java" to="*.out"/>
          <mapper type="glob" from="*.test" to="*.test.out"/>
        </mapper>
        <basenamemapper/>
      </mapper>
    </pathconvert>
    <echo>${p}</echo>

Will echo:
1.test.out:y.out

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message