{"id":1913,"date":"2017-12-06T11:24:55","date_gmt":"2017-12-06T11:24:55","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1913"},"modified":"2020-05-29T07:58:42","modified_gmt":"2020-05-29T07:58:42","slug":"help-in-copy-files-from-list-using-ant","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/help-in-copy-files-from-list-using-ant\/","title":{"rendered":"Help in copy files from list using ant"},"content":{"rendered":"<p><strong>scmuser created the topic: Help in copy files from list using ant<\/strong><br \/>\nHelp in copy files from list using ant<\/p>\n<p>Hi,<\/p>\n<p>I have one file called list.txt where i have mentioned all the files which need to be copied from specific directry.<\/p>\n<p>can you please help me with the right copy task syntax which read the files name from list.txt and copy to destination directory???<\/p>\n<p>tpatil replied the topic: Re:Help in copy files from list using ant<br \/>\nYou can &#8220;for&#8221; loop in build to achieve this<br \/>\nBuild.xml:-<\/p>\n<p><code><for list=\"${copy.files}\" param=\"val\"><br \/>\n    <sequential><br \/>\n       <echo>Copying File @{val}<\/echo><br \/>\n       <copy file=\"@{val}\" todir=\"${destination_dir}\"\/><br \/>\n    <\/sequential><br \/>\n<\/for><\/p>\n<p>Build.properties:-<br \/>\ncopy.files=${src_dir1}\/build\/build.xml,\\<br \/>\n         \t${src_dir2}\/build\/build.xml<\/code><\/p>\n<p><strong>rajeshkumar replied the topic: Re:Help in copy files from list using ant<\/strong><br \/>\nI would recommend following command for same&#8230;<\/p>\n<p><copy todir=\"${}\/lib\" overwrite=\"true\" failonerror=\"false\"><br \/>\n<fileset dir=\"${}\"><br \/>\n<includesfile name=\"${}\/file1.txt\"\/><br \/>\n<\/fileset><br \/>\n<\/copy><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>scmuser replied the topic: Re:Help in copy files from list using ant<\/strong><br \/>\n<copy todir=\"\"><fileset dir=\"\" includelist=\"filelist.txt\"\/><\/copy><\/p>\n<p><strong>amitanand123 replied the topic: Re:Help in copy files from list using ant<\/strong><br \/>\n<copy todir=\"${dest.dir}\/\"><br \/>\n<fileset dir=\"${src}\" includes=\"**\/*.*\"\/><br \/>\n<\/copy><\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: Help in copy files from list using ant 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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[2],"tags":[209],"class_list":["post-1913","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-ant"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=1913"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1913\/revisions"}],"predecessor-version":[{"id":1914,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/1913\/revisions\/1914"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=1913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=1913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=1913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}