How to copy and rename a file using Ant

Syntax:


<copy file="OLD_FILE_NAME" tofile="NEW_FILE_NAME"/>

The copy task has a parameter named tofile, that can be used to pass the new name of a file when copying it. This copies and renames the files at the same time.



References:

Apache Ant

Ant copy