Welcome, Guest
Username Password: Remember me

Help in copy files from list using ant
(1 viewing) (1) Guest
Apache Ant
  • Page:
  • 1

TOPIC: Help in copy files from list using ant

Help in copy files from list using ant 1 year, 9 months ago #336

  • scmuser
  • OFFLINE
  • Gold Boarder
  • scm master
  • Posts: 237
  • Points: 3421
  • Karma: 0
  • Honor Medal 2009
Help in copy files from list using ant

Hi,

I have one file called list.txt where i have mentioned all the files which need to be copied from specific directry.

can you please help me with the right copy task syntax which read the files name from list.txt and copy to destination directory???

Re:Help in copy files from list using ant 1 year, 9 months ago #337

  • tpatil
  • OFFLINE
  • Junior Boarder
  • Posts: 27
  • Points: 5095
  • Karma: 0
  • Honor Medal 2009
You can "for" loop in build to achieve this

 
Build.xml:-
<for list="${copy.files}" param="val">
<sequential>
<echo>Copying File @{val}</echo>
<copy file="@{val}" todir="${destination_dir}"/>
</sequential>
</for>
 
Build.properties:-
copy.files=${src_dir1}/build/build.xml,\
${src_dir2}/build/build.xml
 

Re:Help in copy files from list using ant 1 year, 8 months ago #342

  • rajeshkumar
  • OFFLINE
  • Moderator
  • I love software configuration management
  • Posts: 370
  • Points: 44469
  • Karma: 4
  • Honor Medal 2009
I would recommend following command for same...

<copy todir="${}/lib" overwrite="true" failonerror="false">
<fileset dir="${}">
<includesfile name="${}/file1.txt"/>
</fileset>
</copy>
Regards,
Rajesh Kumar
Build and Release Engineer
My Blog: community.scmgalaxy.com/pg/profile/rajeshkumar

Re:Help in copy files from list using ant 1 year, 8 months ago #353

  • scmuser
  • OFFLINE
  • Gold Boarder
  • scm master
  • Posts: 237
  • Points: 3421
  • Karma: 0
  • Honor Medal 2009
<copy todir=""><fileset dir="" includelist="filelist.txt"/></copy>

Re:Help in copy files from list using ant 1 year, 8 months ago #357

  • amitanand123
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Points: 22
  • Karma: 0
<copy todir="${dest.dir}/">
<fileset dir="${src}" includes="**/*.*"/>
</copy>
  • Page:
  • 1
Time to create page: 1.46 seconds

     
    
Home Forum