You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by EJ Ciramella <ej...@upromise.com> on 2005/12/13 21:53:32 UTC

help with copy and glob mapper

We have a series of templates in a particular directory and I was hoping to use copy/glob mapper/expand properties in order to move them into the build directory AND rename them.  At a point, the directory paths are identical, so what I was hoping to do is something like this:
 
   <copy todir="target" verbose="true">
    <fileset dir="source" includes="**/*"/>
    <globmapper from="template-*" to="*"/>
    <filterchain>
      <expandproperties/>
    </filterchain>
  </copy>
 
But for whatever reason, this only picks up files at the top level (things in source, but not source/somesubdir/someotherdir).
 
Is there a way to do this?

Re: help with copy and glob mapper

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 13 Dec 2005, EJ Ciramella <ej...@upromise.com> wrote:

>    <copy todir="target" verbose="true">
>     <fileset dir="source" includes="**/*"/>
>     <globmapper from="template-*" to="*"/>
>     <filterchain>
>       <expandproperties/>
>     </filterchain>
>   </copy>
>  
> But for whatever reason, this only picks up files at the top level
> (things in source, but not source/somesubdir/someotherdir).

This is because your other files are not matched by the glob pattern
(they don't start with "template" but the directory path leading up to
it.

You need to preserve the directory structure, right?  Otherwise you
could use chained mappers and flatten the file names first.

I currently don't see anything but

<regexpmapper from="^(.*)template-(.*)$$" to="\1\2"/>

Stefan

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