tags:

views:

1629

answers:

1

I would like to use the result of the following filelist (Ant):

<filelist id="docfiles" dir="doc">
    <file name="foo.xml"/>
    <file name="bar.xml"/>
</filelist>

into the following copy :

<copy todir="folder">
??? 
</copy>

I have already tried to put them together like:

<copy todir="folder">
 <filelist id="docfiles" dir="doc">
  <file name="foo.xml"/>
  <file name="bar.xml"/>
 </filelist>
</copy>

But Ant answer that FileLists is not supported in a such task. Thanks.

A: 

As specified in the latest Ant Task Copy documentation:

Parameters specified as nested elements
fileset or any other resource collection

Resource Collections are used to select groups of files to copy. To use a resource collection, the todir attribute must be set.

Prior to Ant 1.7 only <fileset> has been supported as a nested element.

Since Resource Collections include:

  • fileset, dirset, filelist, and path (and derivative types) expose file resources
  • tarfileset can expose file or tarentry resources depending on configuration
  • zipfileset can expose file or zipentry resources depending on configuration
  • propertyset exposes property resources

, a filelist within a copy element should work in Ant1.7.

It will not be supported with Ant 1.6.x

VonC
You need to edit this post and either replace each "<" character with < or put any XML within ` characters like `<fileset>`
Eddie
Duh! Thank you Eddie for the heads-up. Done.
VonC
I thank you VonC
TaintedLove