ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <j_a_fernan...@yahoo.com>
Subject New copy like task
Date Thu, 13 Jun 2002 18:13:06 GMT
Hi people,

I just want to pick your brains for ideas on how to
implement a new task that I have in mind.

I would like to be able to define a new <copy/> like
task that rather than copying from a file set it is
able to copy files from a path of locations only
copying each filename once from the first place in
which it was found. Something like:

<pathcopy dir='dest'>
 <pathfileset path="dir1:dir2:dir3">
   <include name='**'/>
   <exclude name='**/not.this.file'/>
 </pathfileset>
</pathcopy>

If file A.xml is found in dir1 it will be copied and
any A.xml file in dir2 and dir3 will be excluded,
simillarly if B.xsl appears in dir2 and not in dir1 it
will be copied from ther and excluded when looking at
dir3.

I do this today using copy and overwrites, but that
causes files to be updated even if nothing has changed
which is very anoying.

The issue is how to build the task reusing at max what
is already in ANT. I thought </pathfileset> will
produce a <fileset dir='dir1'> to pass to a <copy>
task and then add all the files found in the fileset
as excludes of the next <fileset dir='dir2'> and so
on, that way one gets the desired effect. It may be a
little heavy though.

Those anyone has a better or more elegant idea?

Jose Alberto


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message