如何在Nant脚本中将一个文件夹内容复制到另一个文件夹?

时间:2021-06-11 16:03:46

I need to copy folder A content to folder B using Nant script. If folder B is already existing it should delete first and create new folder named B and copy folder A content to it. How can I do that using Nant script?

我需要使用Nant脚本将文件夹A内容复制到文件夹B.如果文件夹B已经存在,则应首先删除并创建名为B的新文件夹并将文件夹A内容复制到该文件夹​​。我怎么能用Nant脚本做到这一点?

Please help me.

请帮帮我。

Thanks

谢谢

1 个解决方案

#1


1  

You should be able to use a combination of the DELETE and MOVE tasks...

您应该能够使用DELETE和MOVE任务的组合......

<delete dir="${build.dir}" />

<move todir="${build.dir}">
    <fileset basedir="bin">
        <include name="*.dll" />
    </fileset>
</move>

http://nant.sourceforge.net/release/0.85/help/tasks/delete.html

http://nant.sourceforge.net/release/0.85/help/tasks/delete.html

http://nant.sourceforge.net/release/0.85/help/tasks/move.html

http://nant.sourceforge.net/release/0.85/help/tasks/move.html

#1


1  

You should be able to use a combination of the DELETE and MOVE tasks...

您应该能够使用DELETE和MOVE任务的组合......

<delete dir="${build.dir}" />

<move todir="${build.dir}">
    <fileset basedir="bin">
        <include name="*.dll" />
    </fileset>
</move>

http://nant.sourceforge.net/release/0.85/help/tasks/delete.html

http://nant.sourceforge.net/release/0.85/help/tasks/delete.html

http://nant.sourceforge.net/release/0.85/help/tasks/move.html

http://nant.sourceforge.net/release/0.85/help/tasks/move.html