VS2003/VS2005——BUILD编译

来源:互联网 发布:手机短信转移软件 编辑:程序博客网 时间:2024/05/16 08:59

最近遇到编译发布的问题,以前也没怎么写过,对是用别人写的去编译,现在自己动手,感觉蛮有趣的!

VS2003:当前编译的项目有二个,存在公共部分比如后台的DLL都是通用的,只有前台的登录 主页 和个别显示页面有不同;

Separate_BuildTrunk.bat    这个是执行文件,将调用下面的BUILD文件

:: 直接在这里设置环境变量,这样就不用到系统属性里面去设置了。:: 这样可以确保在重新安装系统后,直接从 Source Safe 中把这些 build 脚本拿下来就可以执行了。:: 而且很明确引用了哪些程序。set VSSPath=C:\Program Files\Microsoft Visual Studio\VSS\win32set NAntPath=E:\Build\Tools\nant-0.85-rc2\binset path=%path%;%VSSPath%;%NAntPath%nant -buildfile:Separate_Trunk.build >Separate_Trunk.logxcopy  V:\Build2010\Oct\OCT_PM V:\Build2010\SHTX\SHTX_PM /y /d /s /EXCLUDE:Separate_notcopy.txt


Separate_Trunk.build

<?xml version="1.0" encoding="gb2312"?><!-- Create by: offo Create date : 2006-4-10Description========This version of build can auto get an increment build-version number from Trunk.build.number which is located at the same path of this build file.The tasks of "CopyToServer" and "Label" are depends on "Compiles".If successed compiling then "CMWeb.dll" will be created, so we can check if "CMWeb.dll" exists to determine that if compiling is successed or not.If compiling successed, files in Output folder will be copy to Server and label of the build-version number will be added to SourceSafe.--><project name="Trunk" default="Run"><target name="Run"><!--<call target="CleanLocal"/><call target="CleanServer"/>--><call target="GetOriginalDll" /><call target="GetLatest"/><call target="Compiles" /><call target="CopyToServer" /></target><!--*************************************Configuration properties start.*************************************--><!--Determine that if the files of local or server will be deleted.True is yes, false is not.--><property name="IsCleanLocal" value="false"/><property name="IsCleanServer" value="false"/><!-- SourceSafe --><property name="VSS.UserName" value="build"/>             // vss登录的用户名          <property name="VSS.Password" value="build12903"/>// vss登录的用户密码<property name="VSS.DB" value="T:\srcsafe.ini"/>// vss<property name="VSS.Path" value="$/ESM3.0/ESM3.0_PM"/>// 要编译项目的具体路径<!-- Version --><!--<property name="BranchVersion" value="Trunk" />--><!-- LocalBuildFolders --><property name="BasePath" value="E:\Build\Bat\Oct3.0\Separate"/>//当前本地编译路径<property name="SourcePath" value="${BasePath}\Source"/>//从VSS上面获取下来的项目存储路径<property name="OutputPath" value="${BasePath}\Output\CMESM"/>//编译完后输出路径(项目一)<property name="OutputBinPath" value="${OutputPath}\bin" />//编译完后输出的bin目录(用于存储编译后的后台DLL)<property name="OutputPath1" value="${BasePath}\Output\CMESM_OA"/>//编译完后输出路径(项目二)<property name="OutputBinPath1" value="${OutputPath1}\bin" /><property name="ServerPath" value="O:\OCTWeb\OCT_PM3.0" />//映射到正式发布的电脑路径(通过最后COPY过去也可以直接复//制OUTPUT中的到相对应的电脑中去,这里有两个项目PM3.0和//OA3.0)<property name="ServerPath1" value="O:\OCTWeb\OCT_OA3.0" /><!--Frontend project (which is compiled target to "CMWeb.dll") reference to some dlls, such as CMDAO.dll, iMsgServer2000.dll etc..--><property name="OriginalBinPath" value="V:\Build2010\Oct\devbuild\bin" /><!--*************************************Configuration properties end.*************************************--><!-- Clean the build files of local directory including source and output files.********************************* Pay attention to the use of "defaultexcludes" property。***************--><target name="CleanLocal" if="${IsCleanLocal}" description="Delete all the local source and outputs for a clean build"><delete><fileset basedir="${SourcePath}" defaultexcludes="false"><include name="**/*" /></fileset></delete><delete><fileset basedir="${OutputPath}" defaultexcludes="false"><include name="**/*" /><!--Because of CMTools.dll and CMCommon.dll reference each other, and CMTools.dll will be compiled first,So, CMComm.dll can't be deleted, otherwise, compile will failed.In theory, assemblies can't reference each other. But it's so sad that we have done it!<exclude name="bin/CMCommon.dll" />--></fileset></delete><delete><fileset basedir="${OutputPath1}" defaultexcludes="false"><include name="**/*" /><!--Because of CMTools.dll and CMCommon.dll reference each other, and CMTools.dll will be compiled first,So, CMComm.dll can't be deleted, otherwise, compile will failed.In theory, assemblies can't reference each other. But it's so sad that we have done it!<exclude name="bin/CMCommon.dll" />--></fileset></delete></target><!--Delete all the program files except user data.The paht of "OA" is temporary saved.--><target name="CleanServer" if="${IsCleanServer}"><delete><fileset basedir="${ServerPath}" defaultexcludes="false"><include name="**" /><exclude name="web.config" /><exclude name="aspnet_client/**" /><exclude name="bin/**" /><exclude name="eWebEditor/**" /><exclude name="OA/**" /><exclude name="Ocx/**" /><exclude name="Report/**" /><exclude name="UploadFile/**" /></fileset></delete><delete><fileset basedir="${ServerPath1}" defaultexcludes="false"><include name="**" /><exclude name="web.config" /><exclude name="aspnet_client/**" /><exclude name="bin/**" /><exclude name="eWebEditor/**" /><exclude name="OA/**" /><exclude name="Ocx/**" /><exclude name="Report/**" /><exclude name="UploadFile/**" /></fileset></delete></target><!-- Get original dll --><target name="GetOriginalDll"><copy todir="${OutputBinPath}"><fileset basedir="${OriginalBinPath}"><include name="CMDAO.dll" /><include name="CMBIZLIB.dll" /><include name="CMCommon.dll" /><include name="CMEAI.dll" /><include name="CMReport.dll" /><include name="CMTools.dll" /><!--<include name="CRVsPackageLib.dll" /><include name="CrystalDecisions.CrystalReports.Engine.dll" /><include name="CrystalDecisions.ReportSource.dll" /><include name="CrystalDecisions.Shared.dll" /><include name="CrystalDecisions.Web.dll" /><include name="CrystalDecisions.Windows.Forms.dll" /><include name="CrystalEnterpriseLib.dll" /><include name="CrystalInfoStoreLib.dll" /><include name="CrystalKeyCodeLib.dll" /><include name="CrystalPluginMgrLib.dll" /><include name="CrystalReportPluginLib.dll" /><include name="DllSendSms2.dll" /><include name="iMsgServer2000.dll" /><include name="Microsoft.Web.UI.WebControls.dll" />--></fileset></copy><copy todir="${OutputBinPath1}"><fileset basedir="${OriginalBinPath}"><include name="CMDAO.dll" /><include name="CMBIZLIB.dll" /><include name="CMCommon.dll" /><include name="CMEAI.dll" /><include name="CMReport.dll" /><include name="CMTools.dll" /><!--<include name="CRVsPackageLib.dll" /><include name="CrystalDecisions.CrystalReports.Engine.dll" /><include name="CrystalDecisions.ReportSource.dll" /><include name="CrystalDecisions.Shared.dll" /><include name="CrystalDecisions.Web.dll" /><include name="CrystalDecisions.Windows.Forms.dll" /><include name="CrystalEnterpriseLib.dll" /><include name="CrystalInfoStoreLib.dll" /><include name="CrystalKeyCodeLib.dll" /><include name="CrystalPluginMgrLib.dll" /><include name="CrystalReportPluginLib.dll" /><include name="DllSendSms2.dll" /><include name="iMsgServer2000.dll" /><include name="Microsoft.Web.UI.WebControls.dll" />--></fileset></copy></target><!--Get files from VSS   这里是分别从VSS上面获取源程序到本地想对应的目录中 用于后面的编译--><!-- Get files from VSS --><target name="GetLatest" description="Get the latest files from VSS"><!--CMBizLib--><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMBizLib"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMBizLib"/><!--CMCommon--><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMCommon"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMCommon"/><!--CMDAO--><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMDAO"            recursive="false"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMDAO"/><!--CMEAI--><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMEAI"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMEAI"/><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMESM"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMESM"/><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMESM_OA"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMESM_OA"/><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMReport"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMReport"/><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}\CMTools"            recursive="false"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}/CMTools"/></target><!-- Combination of all compile targets. --><target name="Compiles"><call target="CompileCMDAO"/><call target="CompileCMTools"/><call target="CompileCMCommon"/><call target="CompileCMEAI"/><call target="CompileCMBizLib"/><call target="CompileReport"/><!-- call target="CompileReport_OA"/ --><call target="CompileCMESM"/><call target="CompileCMESM_OA" /></target><!--Compile projects.  后台编译完后,将DLL输出到要发布的BIN目录下--><target name="CompileCMDAO" description="Compile all the .cs files in CMDAO"><csc target="library" output="${OutputPath}\bin\CMDAO.dll" doc="${OutputPath}\bin\CMDAO.xml"><sources><include name="${SourcePath}\CMDAO\*.cs"/></sources></csc><csc target="library" output="${OutputPath1}\bin\CMDAO.dll" doc="${OutputPath1}\bin\CMDAO.xml"><sources><include name="${SourcePath}\CMDAO\*.cs"/></sources></csc></target><!--Compile CMTools.--><target name="CompileCMTools" description="Compile all the .cs files in CMTools"><csc target="library" output="${OutputPath}\bin\CMTools.dll" doc="${OutputPath}\bin\CMTools.xml"><sources><include name="${SourcePath}\CMTools\*.cs"/></sources><references><include name="${OutputPath}\bin\CMDAO.dll" /></references></csc><csc target="library" output="${OutputPath1}\bin\CMTools.dll" doc="${OutputPath1}\bin\CMTools.xml"><sources><include name="${SourcePath}\CMTools\*.cs"/></sources><references><include name="${OutputPath}\bin\CMDAO.dll" /></references></csc></target><!--Compile CMCommon.--><target name="CompileCMCommon" description="Compile all the .cs files in CMCommon"><csc target="library" output="${OutputPath}\bin\CMCommon.dll" doc="${OutputPath}\bin\CMCommon.xml"><sources><include name="${SourcePath}\CMCommon\*.cs"/></sources><references><include name="${OutputPath}\bin\CMDAO.dll" /><include name="${OutputPath}\bin\CMTools.dll" /></references></csc><csc target="library" output="${OutputPath1}\bin\CMCommon.dll" doc="${OutputPath1}\bin\CMCommon.xml"><sources><include name="${SourcePath}\CMCommon\*.cs"/></sources><references><include name="${OutputPath1}\bin\CMDAO.dll" /><include name="${OutputPath1}\bin\CMTools.dll" /></references></csc></target><!--Compile CMEAI.--><target name="CompileCMEAI" description="Compile all the .cs files in CMEAI"><csc target="library" output="${OutputPath}\bin\CMEAI.dll" doc="${OutputPath}\bin\CMEAI.xml"><sources><include name="${SourcePath}\CMEAI\*.cs"/><include name="${SourcePath}\CMEAI\USERIO\*.cs"/></sources><references><include name="${OutputPath}\bin\CMDAO.dll" /><include name="${OutputPath}\bin\CMTools.dll" /><include name="${OutputPath}\bin\CMCommon.dll"/>"</references></csc><csc target="library" output="${OutputPath1}\bin\CMEAI.dll" doc="${OutputPath1}\bin\CMEAI.xml"><sources><include name="${SourcePath}\CMEAI\*.cs"/><include name="${SourcePath}\CMEAI\USERIO\*.cs"/></sources><references><include name="${OutputPath1}\bin\CMDAO.dll" /><include name="${OutputPath1}\bin\CMTools.dll" /><include name="${OutputPath1}\bin\CMCommon.dll"/>"</references></csc></target><!--Compile CMBizLib.--><target name="CompileCMBizLib" description="Compile all the .cs files in CMBizLib"><csc target="library" output="${OutputPath}\bin\CMBizLib.dll" doc="${OutputPath}\bin\CMBizLib.xml"><sources><include name="${SourcePath}\CMBizLib\*.cs"/></sources><references><include name="${OutputPath}\bin\CMDAO.dll" /><include name="${OutputPath}\bin\CMTools.dll" /><include name="${OutputPath}\bin\CMCommon.dll"/><include name="${OutputPath}\bin\CMReport.dll" /><include name="${OutputPath}\bin\CrystalDecisions.CrystalReports.Engine.dll" /><include name="${OutputPath}\bin\CrystalDecisions.ReportSource.dll" /><include name="${OutputPath}\bin\CrystalDecisions.Shared.dll" /><include name="${OutputPath}\bin\CrystalDecisions.Web.dll" /><include name="${OutputPath}\bin\CrystalDecisions.Windows.Forms.dll" /><include name="${OutputPath}\bin\CrystalEnterpriseLib.dll" /><include name="${OutputPath}\bin\CrystalInfoStoreLib.dll" /><include name="${OutputPath}\bin\CrystalKeyCodeLib.dll" /><include name="${OutputPath}\bin\CrystalPluginMgrLib.dll" /><include name="${OutputPath}\bin\CrystalReportPluginLib.dll" /></references></csc><csc target="library" output="${OutputPath1}\bin\CMBizLib.dll" doc="${OutputPath1}\bin\CMBizLib.xml"><sources><include name="${SourcePath}\CMBizLib\*.cs"/></sources><references><include name="${OutputPath1}\bin\CMDAO.dll" /><include name="${OutputPath1}\bin\CMTools.dll" /><include name="${OutputPath1}\bin\CMCommon.dll"/><include name="${OutputPath1}\bin\CMReport.dll" /><include name="${OutputPath1}\bin\CrystalDecisions.CrystalReports.Engine.dll" /><include name="${OutputPath1}\bin\CrystalDecisions.ReportSource.dll" /><include name="${OutputPath1}\bin\CrystalDecisions.Shared.dll" /><include name="${OutputPath1}\bin\CrystalDecisions.Web.dll" /><include name="${OutputPath1}\bin\CrystalDecisions.Windows.Forms.dll" /><include name="${OutputPath1}\bin\CrystalEnterpriseLib.dll" /><include name="${OutputPath1}\bin\CrystalInfoStoreLib.dll" /><include name="${OutputPath1}\bin\CrystalKeyCodeLib.dll" /><include name="${OutputPath1}\bin\CrystalPluginMgrLib.dll" /><include name="${OutputPath1}\bin\CrystalReportPluginLib.dll" /></references></csc></target><target name="CompileReport"  description="Compile all the .cs files in CMReport"><csc target="library" output="${OutputPath}\bin\CMReport.dll" doc="${OutputPath}\bin\CMReport.xml"><sources><include name="${SourcePath}\CMReport\*.cs"/></sources><resources prefix="CMESM_Report"><include name="${SourcePath}\CMReport\*.rpt" /></resources><references><include name="${OutputBinPath}\CrystalDecisions.Web.dll"/><include name="${OutputBinPath}\CrystalDecisions.Shared.dll"/><include name="${OutputBinPath}\CrystalDecisions.Windows.Forms.dll"/><include name="${OutputBinPath}\CrystalReportPluginLib.dll"/><include name="${OutputBinPath}\CrystalPluginMgrLib.dll"/><include name="${OutputBinPath}\CrystalKeyCodeLib.dll"/><include name="${OutputBinPath}\CrystalInfoStoreLib.dll"/><include name="${OutputBinPath}\CrystalEnterpriseLib.dll"/><include name="${OutputBinPath}\CrystalDecisions.ReportSource.dll"/><include name="${OutputBinPath}\CrystalDecisions.CrystalReports.Engine.dll"/></references></csc></target><!-- 编译第一个项目 --><target name="CompileCMESM"><csc target="library" output="${OutputBinPath}\CMESM.dll" ><sources><include name="${SourcePath}\CMESM\*.cs"/></sources><references><include name="${OutputBinPath}\CMBIZLIB.dll" /><include name="${OutputBinPath}\CMCommon.dll" /><include name="${OutputBinPath}\CMDAO.dll" /><include name="${OutputBinPath}\CMEAI.dll" /><include name="${OutputBinPath}\CMReport.dll" /><include name="${OutputBinPath}\CMTools.dll" /><include name="${OutputBinPath}\CRVsPackageLib.dll" /><include name="${OutputBinPath}\CrystalDecisions.CrystalReports.Engine.dll" /><include name="${OutputBinPath}\CrystalDecisions.ReportSource.dll" /><include name="${OutputBinPath}\CrystalDecisions.Shared.dll" /><include name="${OutputBinPath}\CrystalDecisions.Web.dll" /><include name="${OutputBinPath}\CrystalDecisions.Windows.Forms.dll" /><include name="${OutputBinPath}\CrystalEnterpriseLib.dll" /><include name="${OutputBinPath}\CrystalInfoStoreLib.dll" /><include name="${OutputBinPath}\CrystalKeyCodeLib.dll" /><include name="${OutputBinPath}\CrystalPluginMgrLib.dll" /><include name="${OutputBinPath}\CrystalReportPluginLib.dll" /><include name="${OutputBinPath}\DllSendSms2.dll" /><include name="${OutputBinPath}\iMsgServer2000.dll" /><include name="${OutputBinPath}\Microsoft.Web.UI.WebControls.dll" /></references></csc><!-- Copy aspx files to output folder --><copy todir="${OutputPath}"><fileset basedir="${SourcePath}\CMESM"><include name="**" /><!-- Files do not be copyed. --><exclude name="web.config" /><exclude name="*.cs" /><exclude name="*.resx" /><exclude name="*.csproj" /><exclude name="*.csproj.webinfo" /><exclude name="*.sln" /><exclude name="*.bak" /><exclude name="*.vsdisco" /><exclude name="*.scc" /><exclude name="*.asp" /><exclude name="*.rpt" /><exclude name="*.xsd" /><exclude name="*.xsx" /><exclude name="bin\CrystalDecisions.Web.dll"/><exclude name="bin\CrystalDecisions.Shared.dll"/><exclude name="bin\CrystalDecisions.Windows.Forms.dll"/><exclude name="bin\CrystalReportPluginLib.dll"/><exclude name="bin\CrystalPluginMgrLib.dll"/><exclude name="bin\CrystalKeyCodeLib.dll"/><exclude name="bin\CrystalInfoStoreLib.dll"/><exclude name="bin\CrystalEnterpriseLib.dll"/><exclude name="bin\CrystalDecisions.ReportSource.dll"/><exclude name="bin\CrystalDecisions.CrystalReports.Engine.dll"/></fileset></copy></target><!-- 编译第二个项目 --><target name="CompileCMESM_OA"><csc target="library" output="${OutputBinPath1}\CMESM.dll" ><sources><include name="${SourcePath}\CMESM_OA\*.cs"/></sources><references><include name="${OutputBinPath1}\CMBIZLIB.dll" /><include name="${OutputBinPath1}\CMCommon.dll" /><include name="${OutputBinPath1}\CMDAO.dll" /><include name="${OutputBinPath1}\CMEAI.dll" /><include name="${OutputBinPath1}\CMReport.dll" /><include name="${OutputBinPath1}\CMTools.dll" /><include name="${OutputBinPath1}\CRVsPackageLib.dll" /><include name="${OutputBinPath1}\CrystalDecisions.CrystalReports.Engine.dll" /><include name="${OutputBinPath1}\CrystalDecisions.ReportSource.dll" /><include name="${OutputBinPath1}\CrystalDecisions.Shared.dll" /><include name="${OutputBinPath1}\CrystalDecisions.Web.dll" /><include name="${OutputBinPath1}\CrystalDecisions.Windows.Forms.dll" /><include name="${OutputBinPath1}\CrystalEnterpriseLib.dll" /><include name="${OutputBinPath1}\CrystalInfoStoreLib.dll" /><include name="${OutputBinPath1}\CrystalKeyCodeLib.dll" /><include name="${OutputBinPath1}\CrystalPluginMgrLib.dll" /><include name="${OutputBinPath1}\CrystalReportPluginLib.dll" /><include name="${OutputBinPath1}\DllSendSms2.dll" /><include name="${OutputBinPath1}\iMsgServer2000.dll" /><include name="${OutputBinPath1}\Microsoft.Web.UI.WebControls.dll" /></references></csc><!-- Copy aspx files to output folder --><copy todir="${OutputPath1}"><fileset basedir="${SourcePath}\CMESM_OA"><include name="**" /><!-- Files do not be copyed. --><exclude name="web.config" /><exclude name="*.cs" /><exclude name="*.resx" /><exclude name="*.csproj" /><exclude name="*.csproj.webinfo" /><exclude name="*.sln" /><exclude name="*.bak" /><exclude name="*.vsdisco" /><exclude name="*.scc" /><exclude name="*.asp" /><exclude name="*.rpt" /><exclude name="*.xsd" /><exclude name="*.xsx" /><exclude name="bin\CrystalDecisions.Web.dll"/><exclude name="bin\CrystalDecisions.Shared.dll"/><exclude name="bin\CrystalDecisions.Windows.Forms.dll"/><exclude name="bin\CrystalReportPluginLib.dll"/><exclude name="bin\CrystalPluginMgrLib.dll"/><exclude name="bin\CrystalKeyCodeLib.dll"/><exclude name="bin\CrystalInfoStoreLib.dll"/><exclude name="bin\CrystalEnterpriseLib.dll"/><exclude name="bin\CrystalDecisions.ReportSource.dll"/><exclude name="bin\CrystalDecisions.CrystalReports.Engine.dll"/></fileset></copy></target><!--Copy files to server.  将本机编译完成的项目复制到其他电脑中去--><target name="CopyToServer" if="${file::exists(OutputBinPath + '\CMESM.dll')}"><copy todir="${ServerPath}"><fileset basedir="${OutputPath}"><include name="**/*" /></fileset></copy><copy todir="${ServerPath1}"><fileset basedir="${OutputPath1}"><include name="**/*" /></fileset></copy></target></project>


Separate_Trunk.log 这个是日志文件,可以起到监控的情况

 

VS2005:这个的话就简单多了,同样是两个项目,稍微不同的是,前台WEB项目和后台WEB管理项目

C8.bat

@echo offset FrameworkPath=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727set NAntPath=D:\Build2010\Tools\nant-0.85-bin\nant-0.85\binset NunitPath=D:\Build2010\Tools\NUnit-2.4.8-net-2.0\binset FxCopPath=D:\Build2010\Tools\Microsoft FxCop 1.36set path=%path%;%NAntPath%;% NunitPath %;% FxCopPath %;% FrameworkPath %nant -buildfile:C8.build > C8.log

看到不同了吧 ,开始调用的就有了区别!

C8.build

<?xml version="1.0" encoding="gb2312"?><!-- Create by: PhilCreate date : 2008-7-31Description : 这个Build文件编译WEB层,执行内容为:1、清空服务器上文件2、编译解决方案文件3、拷贝文件到服务器4、执行FxCop5、生成XML结果--><project name="Trunk" default="Run"><target name="Run"><call target="CleanServer"/><call target="CleanOutPut" /><call target="Checkout"/><call target="Compiles" /><!--<call target="FxCop" />--><call target="CopyToServer" /></target><!--*************************************Configuration properties start.*************************************--><!--Determine that if the files of local or server will be deleted.True is yes, false is not.--><property name="IsCleanServer" value="false"/><!-- SourceSafe --><property name="VSS.UserName" value="soso"/><property name="VSS.Password" value="sosotest"/><property name="VSS.DB" value="z:\C8VssDB\srcsafe.ini"/><property name="VSS.Path" value="$/C8/C8_New"/><!-- LocalBuildFolders --><property name="BasePath" value="D:\Build2010\"/><property name="SourcePath" value="${BasePath}\Source\C8_New"/><property name="OutputPath" value="${BasePath}\Output\C8_New\Chiming.Admin.Web"/><property name="OutputBinPath" value="${OutputPath}\bin" /><property name="OutputPath1" value="${BasePath}\Output\C8_New\Chiming.Web"/><property name="OutputBinPath1" value="${OutputPath1}\bin" /><!--Solution--><property name="Solution.Filename" value="${SourcePath}\\C8_New.sln" />    <property name="Solution.Configuration" value="DEBUG" />    <property name="Build.OutputFolder" value="${OutputBinPath}"/><property name="ReferBinPath" value="${SourcePath}\bin" /><!--Server path. If property "IsCleanServer" is signed "true", files in this path will be delete.Just be careful!!!!!!--><property name="ServerPath" value="D:\Build2010\Publish\C8_New\" /><target name="CleanServer" if="${IsCleanServer}"><delete><fileset basedir="${ServerPath}" defaultexcludes="false"><include name="**" /><exclude name="*.config" /><exclude name="aspnet_client/**" /><exclude name="eWebEditor/**" /><exclude name="UploadFile/**" />        <exclude name="XG_Log/**" /></fileset></delete></target>      <target name="CleanOutPut" if="${IsCleanServer}"><delete><fileset basedir="${OutputPath}" defaultexcludes="false"><include name="**" /></fileset></delete><delete><fileset basedir="${OutputPath1}" defaultexcludes="false"><include name="**" /></fileset></delete></target><!--Get files from VSS --><target name="Checkout" description="Get the latest files from VSS"><vssgetusername="${VSS.UserName}"            password="${VSS.Password}"            localpath="${SourcePath}"            recursive="true"            replace="true"            writable="true"            dbpath="${VSS.DB}"            path="${VSS.Path}"filetimestamp="Updated"/></target><!-- Combination of all compile targets. --><target name="Compiles"><exec program="C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\msbuild.exe" commandline="${SourcePath}\C8_New.sln" /><!-- Copy aspx files to output folder --><copy todir="${OutputPath}"><fileset basedir="${SourcePath}\Chiming.Admin.Web"><include name="**" /><!-- Files do not be copyed. --><exclude name="web.config" /><exclude name="**\*.cs" /><exclude name="**\*.resx" /><exclude name="**\*.csproj" /><exclude name="**\*.csproj.webinfo" /><exclude name="**\*.sln" /><exclude name="**\*.bak" /><exclude name="**\*.vsdisco" /><exclude name="**\*.scc" /><!--<exclude name="**\*.asp" /> --><exclude name="**\*.rpt" /><exclude name="**\*.xsd" /><exclude name="**\*.xsx" /><exclude name="**\*.vspscc" /><exclude name="**\*.user" /><exclude name="**\*.pdb" /><exclude name="**\*user" /></fileset></copy><copy todir="${OutputPath1}"><fileset basedir="${SourcePath}\Chiming.Web"><include name="**" /><!-- Files do not be copyed. --><exclude name="web.config" /><exclude name="**\*.cs" /><exclude name="**\*.resx" /><exclude name="**\*.csproj" /><exclude name="**\*.csproj.webinfo" /><exclude name="**\*.sln" /><exclude name="**\*.bak" /><exclude name="**\*.vsdisco" /><exclude name="**\*.scc" /><!--<exclude name="**\*.asp" /> --><exclude name="**\*.rpt" /><exclude name="**\*.xsd" /><exclude name="**\*.xsx" /><exclude name="**\*.vspscc" /><exclude name="**\*.user" /><exclude name="**\*.pdb" /><exclude name="**\*user" /></fileset></copy></target><!-- fxcop Code Checking --><target name="FxCop"><exec program="fxcopcmd" commandline="${FxCopCommandLine}" /></target>  <!--Copy files to server.--><target name="CopyToServer"><copy todir="${ServerPath}"><fileset basedir="${OutputPath}"><include name="**/*" /><exclude name="**\*user" /></fileset></copy><copy todir="${ServerPath}"><fileset basedir="${OutputPath1}"><include name="**/*" /><exclude name="**\*user" /></fileset></copy></target></project>

这个就这么简单,不在多说了!
同样有个日志文件C8.log

E:\Build\Tools\nant-0.85-rc2\bin 这个我就不知道怎么放了!
原创粉丝点击