ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilbert Rebhan <...@schillbaer.de>
Subject Re: task to 'cp -r --reply=no'
Date Tue, 12 Jun 2007 19:41:11 GMT
Hi,

Matt Benson wrote:
> Hi Chris:
>   Try using a <present present="srconly" ... />
> selector with your source <fileset>.
> 
> HTH,
> Matt

Nice :-)


before =

J:\copyfrom\subdir1\
J:\copyfrom\subdir1\build.xml
J:\copyfrom\subdir2\
J:\copyfrom\subdir2\subsub2\build.xml
J:\copyfrom\build.xml

and
J:\copyto is a blank directory

with =

<?xml version="1.0"?>

<project name="bla" default="main">

   <target name="init">
     <fileset dir="J:/copyfrom" includes="**/*.xml" id="newfiles">
       <present present="srconly" targetdir="J:/copyto"/>
     </fileset>
   </target>

     <target name="main" depends="init">
     <echo>
      Files to copy = ${line.separator}${toString:newfiles}
     </echo>

     <copy todir="J:/copyto">
       <fileset refid="newfiles"/>
     </copy>

   </target>

</project>

first run =

Buildfile: J:\eclipse_3_2\workspace\AntTest\test.xml
init:
main:
      [echo] Files to copy =
      [echo] build.xml;subdir1\build.xml;subdir2\subsub2\build.xml
      [copy] Copying 3 files to J:\copyto
BUILD SUCCESSFUL
Total time: 891 milliseconds

the blank directory gets filled with meat =

J:\copyto\subdir1\
J:\copyto\subdir1\build.xml
J:\copyto\subdir2\
J:\copyto\subdir2\subsub2\build.xml
J:\copyto\build.xml

second run =

Buildfile: J:\eclipse_3_2\workspace\AntTest\test.xml
init:
main:
      [echo] Files to copy =
BUILD SUCCESSFUL
Total time: 516 milliseconds

so no files are copied, as already present in targetdir ...


Blank directorie are not copied, how to achieve that if wanted ?
(manual says <cop<> task is set to ncludeEmptyDirs="true" ?


Regards, Gilbert






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


Mime
View raw message