如何将一个文件夹使用Ant改名? [英] How to rename a folder using Ant?

查看:379
本文介绍了如何将一个文件夹使用Ant改名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想时间戳来重命名我的应用程序文件夹,然后解压缩使用相同的文件夹名称,我的应用程序的新版本。使用Ant 移动任务),它看起来你可以从一个文件夹的内容移动到另一个。

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 the Ant (move task), it looks like you can move contents from one folder to another.

这是唯一的办法,我可以在蚂蚁做到这一点?

Is this the only way I can do this in Ant?

推荐答案

此举任务没有做什么你之后,但在命名比较混乱。如果你认为你的目录是Java中的一个文件 - 一个文件是一个文件系统句柄可以重新present,其中包括一个目录或通常意义的文件 - 那么此举任务是有道理的。

The move task does do what you're after, but the naming is a bit confusing. If you consider your directory is a 'file' in the Java sense - a file being a filesystem handle that can represent, among others a directory or a file in the usual sense - then the move task makes sense.

所以下面

<move file="mySourceDirName" tofile="myTargetDirName"/>

意味着重命名/移动目录 mySourceDirName 来代替 myTargetDirName

下面再

<move file="mySourceDirName" todir="someExistingDir"/>

意味着移动目录 mySourceDirName 成为一个子目录现有的 someExistingDir 目录

means to move the directory mySourceDirName to become a child directory of the existing someExistingDir directory.

所以,在蚂蚁的文件属性指的是有问题的目标,而todir属性指的是目标文件或目录的新的父位置的目录。

So, in ant the 'file' attribute refers to the target in question, and the 'todir' attribute refers to the directory that is the new parent location for the target file or directory.

这篇关于如何将一个文件夹使用Ant改名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆