tags:

views:

1124

answers:

2

I want to rename my application folder with a time stamp and then unzip a newer version of my app using the same folder name using ant. From the following link, it looks like ant can allow you to move contents from a folder to another (http://ant.apache.org/manual/CoreTasks/move.html), is this the only way I can do in ant?

Thanks in advance.

A: 

I think the move task is what you want. Is there some reason you don't want to use it?

It sounds like you're proposing moving the folder in which your build.xml file lives. Is that right? If so, I imagine ant might not be too happy it.

Paul A Jungwirth
Right now in my build.xml I have it to delete the folder and then unzip a zip file which automatically creates a new folder with the same folder name. Now instead of delete the folder,I'd like to have it renamed with a timestamp appended to the folder name.
JLau
A: 

Just spelling out the answer already given, which is correct...

<project default="move">
    <tstamp/>
    <target name="move">
        <move file="foo" tofile="foo-${TSTAMP}"/>
    </target>
</project>

This moves foo to foo-HHMM.

sudocode
I change tofile to todir and it works fine. Thanks.
JLau