Friday 27 December 2013

Move Task - Ant

Move task in Ant is used to move a file or a directory or a set of files to a new directory.


  • Move task can also be used rename a single file (analogous to mv command in unix)
Eg:

<move file="test.txt" tofile="test_updated.txt" />


  • You can use to move a file to a specific directory as follows:
Eg:

<move file="test.txt" todir="/usr/var/move_here/" />


  • Move a set of files to a certain directory

Eg:

<move todir="/usr/var/mover_here/">
    <fileset dir="/my/src/dir_to_be_moved">
         <include name = **/*.jar >
         <exclude name = **/ant.jar">
     </fileset>
</move>  

A detailed official guide of the Move task and its parameters can be found here.



No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker