ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <>
Subject Re: Replace extension with mapper
Date Thu, 03 Feb 2005 13:33:39 GMT
Ant's globmapper does not support more that one "*".
You need to use a regexpmapper, for example:

  <target name="h">
    <delete dir="hh" quiet="yes"/>
    <delete dir="newdir" quiet="yes"/>
    <mkdir dir="hh"/>
    <mkdir dir="hh/subdir"/>
    <touch file="hh/x.html"/>
    <touch file="hh/y.htm"/>
    <touch file="hh/subdir/x.html"/>
    <copy todir="newdir">
      <fileset dir="hh">
        <include name = "**/*.html"/>
        <include name = "**/*.htm"/>
        <regexpmapper from="(.*)\.html*" to="\1.xhtml"/>

Robert Soesemann wrote:

>While copy HTML files (*.htm or *.html) to another folder, I want to
>rename the extension of all those files to *.xhtml.
>I tried this, but it didn't work. Can you help?	
><copy todir="${regexp_dir}">
>	<fileset dir="${html_dir}">
>		<include name="**/*.htm"/>
>		include name="**/*.html"/>
>	</fileset>
>	<mapper type="glob" from="*.htm*" to="*.xhtml"/>
>Best regards,
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message