ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: fileset question
Date Wed, 22 Nov 2000 09:51:25 GMT
Diane Holt <holtdl@yahoo.com> wrote:

> But maybe Stefan will have some trick up his sleeve that can do that
> for you.

Me or another Stefan? OK, I'll give it a try.

In Jason's very first mail he used includesfile on the new directory,
so we can assume there is somebody that can put together a list of
directories that need to get copied/moved.

So let's say, there are directories new/a, new/b and new/c that should
replace the ones in orig. Create a file new/filelist.txt with the
following content

-------------------------snip---------------------------
a/**
b/**
c/**
------------------------/snip---------------------------

This is what Jason wanted to do anyway, just added the ** to make sure
the patterns match more than just the directories themselves.

Next define your patternset, either outside any target (if possible,
this happens at parser time) like this

<patternset id="the.dirs" includesfile="new/filelist.txt" />

or in process when using the first move task. I'd use the latter approach

<move todir="backup" >
  <fileset dir="orig" >
    <patternset id="the.dirs" includesfile="new/filelist.txt" />
    <!-- use this when the.dirs has been defined before
      <patternset refid="the.dirs"/>
    -->
  </fileset>
</move>

and finally

<move todir="orig" >
  <fileset dir="new" >
    <patternset refid="the.dirs"/>
  </fileset>
</move>

Does this do what you want Jason?

Stefan

Mime
View raw message