自動複製指定文件到指定目錄中的NANT腳本

一段自動複製指定文件到指定目錄中的NANT腳本build.build,這樣就不用擔心複製文件會出錯了。如下



1 <?xml version="1.0" encoding="gb2312" ?>

2 <project name="MyTest" default="run">
3     <property name="basename" value="WebSite"/>
4     <property name="debug" value="true"/>
5     <property name="base.dir" value="源文件來" />
6     <property name="deploy.dir" value="目的文件夾" />
7     <property name="FxCop.dir" value="http://www.cnblogs.com/../deploy" /> 
8     <target name="clean">
9     
10     </target>
11     <target name="deploy" depends="clean">    
12     <!--********** 將projectA相關的dll拷貝到各個站點的bin目錄下 Begin    **********-->
13     <copy todir="${deploy.dir}/WebSiteA/bin">
14         <fileset basedir="${base.dir}/bin/Release/">
15                 <include name="*.dll" />
16             </fileset>
17     </copy>
18     <copy todir="${deploy.dir}/WebSiteB/bin">
19         <fileset basedir="${base.dir}/bin/Release/">
20                 <include name="*.dll" />
21             </fileset>
22     </copy>
23     <copy todir="${deploy.dir}/WebSiteC/bin">
24         <fileset basedir="${base.dir}/Release/">
25                 <include name="*.dll" />
26             </fileset>
27     </copy>
28     <copy todir="${deploy.dir}/WebSiteD/bin">
29         <fileset basedir="${base.dir}/bin/Release/">
30                 <include name="*.dll" />
31             </fileset>
32     </copy>
33         <copy todir="${deploy.dir}/WebSiteE/bin">
34         <fileset basedir="${base.dir}/bin/Release/">
35                 <include name="*.dll" />
36             </fileset>
37     </copy>
38     <!--**********將projectA相關的dll拷貝到各個站點的bin目錄下 End    **********-->    
39     </target>
40 <target name="run" depends="fxcop">
41     </target>
42     <target name="fxcop" depends="deploy">
43         
44     </target>
45 </project>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章