ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: obtaining expanded pathnames [pattern matching] [newbie]
Date Thu, 05 Jul 2001 05:48:22 GMT
On Thu, 05 Jul 2001, dave young <> wrote:

> there is a set of files matching the following path that i wish to
> copy; castor*/src/main/org/exolab/**
> now, the thing is, that i need to place them into another directory
> and don't wish to have the castor*/src/main bit of the filename,
> just the remainder.

Let me see if I get this correctly, sounds as if you could easily do
this with a regexp-mapper.  (1) You have to use Ant 1.3 or later and
(2) need jakarta-regexp or jakarta-ORO in your CLASSPATH, then do
something like this

<copy todir="mydestdir">
  <fileset dir="mysrcdir">
    <include name="castor*/src/main/org/exolab/**" />

  <mapper type="regexp" from="castor.*/src/main/(.*)" to="\1" />

The include will make sure that you don't copy any files you don't
need and the mapper will strip off the castor*/src/main/ part.


View raw message