1. 首页
  2. IT资讯

VS2003/VS2005——BUILD编译

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

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

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

:: 直接在这里设置环境变量,这样就不用到系统属性里面去设置了。 :: 这样可以确保在重新安装系统后,直接从 Source Safe 中把这些 build 脚本拿下来就可以执行了。 :: 而且很明确引用了哪些程序。  set VSSPath=C:Program FilesMicrosoft Visual StudioVSSwin32 set NAntPath=E:BuildToolsnant-0.85-rc2bin  set path=%path%;%VSSPath%;%NAntPath%  nant -buildfile:Separate_Trunk.build >Separate_Trunk.log xcopy  V:Build2010OctOCT_PM V:Build2010SHTXSHTX_PM /y /d /s /EXCLUDE:Separate_notcopy.txt

Separate_Trunk.build

<?xml version="1.0" encoding="gb2312"?> <!--  Create by		: offo  Create date : 2006-4-10  Description ======== 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:BuildBatOct3.0Separate"/>	//当前本地编译路径 	<property name="SourcePath" value="${BasePath}Source"/>		//从VSS上面获取下来的项目存储路径 	<property name="OutputPath" value="${BasePath}OutputCMESM"/>		//编译完后输出路径(项目一) 	<property name="OutputBinPath" value="${OutputPath}bin" />		//编译完后输出的bin目录(用于存储编译后的后台DLL)  	<property name="OutputPath1" value="${BasePath}OutputCMESM_OA"/>	//编译完后输出路径(项目二) 	<property name="OutputBinPath1" value="${OutputPath1}bin" />  	 	<property name="ServerPath" value="O:OCTWebOCT_PM3.0" />		//映射到正式发布的电脑路径(通过最后COPY过去也可以直接复									//制OUTPUT中的到相对应的电脑中去,这里有两个项目PM3.0和									//OA3.0) 	<property name="ServerPath1" value="O:OCTWebOCT_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:Build2010Octdevbuildbin" /> 	<!-- 		************************************* 		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 		--> 		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMBizLib"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMBizLib" 		/>  		<!-- 		CMCommon 		--> 		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMCommon"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMCommon" 		/>  		<!-- 		CMDAO 		--> 		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMDAO"             recursive="false"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMDAO" 		/>  		<!-- 		CMEAI 		--> 		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMEAI"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMEAI" 		/>  		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMESM"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMESM" 		/>  		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMESM_OA"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMESM_OA" 		/>  		<vssget 			username="${VSS.UserName}"             password="${VSS.Password}"             localpath="${SourcePath}CMReport"             recursive="true"             replace="true"             writable="true"             dbpath="${VSS.DB}"             path="${VSS.Path}/CMReport"			 		/> 		<vssget 			username="${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}binCMDAO.dll" doc="${OutputPath}binCMDAO.xml"> 			<sources> 				<include name="${SourcePath}CMDAO*.cs"/> 			</sources> 		</csc> 		<csc target="library" output="${OutputPath1}binCMDAO.dll" doc="${OutputPath1}binCMDAO.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}binCMTools.dll" doc="${OutputPath}binCMTools.xml"> 			<sources> 				<include name="${SourcePath}CMTools*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath}binCMDAO.dll" /> 			</references> 		</csc> 		<csc target="library" output="${OutputPath1}binCMTools.dll" doc="${OutputPath1}binCMTools.xml"> 			<sources> 				<include name="${SourcePath}CMTools*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath}binCMDAO.dll" /> 			</references> 		</csc> 	</target>  	<!-- 		Compile CMCommon. 	--> 	<target name="CompileCMCommon" description="Compile all the .cs files in CMCommon"> 		<csc target="library" output="${OutputPath}binCMCommon.dll" doc="${OutputPath}binCMCommon.xml"> 			<sources> 				<include name="${SourcePath}CMCommon*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath}binCMDAO.dll" /> 				<include name="${OutputPath}binCMTools.dll" /> 			</references> 		</csc> 		<csc target="library" output="${OutputPath1}binCMCommon.dll" doc="${OutputPath1}binCMCommon.xml"> 			<sources> 				<include name="${SourcePath}CMCommon*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath1}binCMDAO.dll" /> 				<include name="${OutputPath1}binCMTools.dll" /> 			</references> 		</csc> 	</target>  	<!-- 		Compile CMEAI. 	--> 	<target name="CompileCMEAI" description="Compile all the .cs files in CMEAI"> 		<csc target="library" output="${OutputPath}binCMEAI.dll" doc="${OutputPath}binCMEAI.xml"> 			<sources> 				<include name="${SourcePath}CMEAI*.cs"/> 				<include name="${SourcePath}CMEAIUSERIO*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath}binCMDAO.dll" /> 				<include name="${OutputPath}binCMTools.dll" /> 				<include name="${OutputPath}binCMCommon.dll"/>" 			</references> 		</csc> 		<csc target="library" output="${OutputPath1}binCMEAI.dll" doc="${OutputPath1}binCMEAI.xml"> 			<sources> 				<include name="${SourcePath}CMEAI*.cs"/> 				<include name="${SourcePath}CMEAIUSERIO*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath1}binCMDAO.dll" /> 				<include name="${OutputPath1}binCMTools.dll" /> 				<include name="${OutputPath1}binCMCommon.dll"/>" 			</references> 		</csc> 	</target>  	<!-- 		Compile CMBizLib. 	--> 	<target name="CompileCMBizLib" description="Compile all the .cs files in CMBizLib"> 		<csc target="library" output="${OutputPath}binCMBizLib.dll" doc="${OutputPath}binCMBizLib.xml"> 			<sources> 				<include name="${SourcePath}CMBizLib*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath}binCMDAO.dll" /> 				<include name="${OutputPath}binCMTools.dll" /> 				<include name="${OutputPath}binCMCommon.dll"/> 				<include name="${OutputPath}binCMReport.dll" /> 				<include name="${OutputPath}binCrystalDecisions.CrystalReports.Engine.dll" /> 				<include name="${OutputPath}binCrystalDecisions.ReportSource.dll" /> 				<include name="${OutputPath}binCrystalDecisions.Shared.dll" /> 				<include name="${OutputPath}binCrystalDecisions.Web.dll" /> 				<include name="${OutputPath}binCrystalDecisions.Windows.Forms.dll" /> 				<include name="${OutputPath}binCrystalEnterpriseLib.dll" /> 				<include name="${OutputPath}binCrystalInfoStoreLib.dll" /> 				<include name="${OutputPath}binCrystalKeyCodeLib.dll" /> 				<include name="${OutputPath}binCrystalPluginMgrLib.dll" /> 				<include name="${OutputPath}binCrystalReportPluginLib.dll" /> 			</references> 		</csc> 		<csc target="library" output="${OutputPath1}binCMBizLib.dll" doc="${OutputPath1}binCMBizLib.xml"> 			<sources> 				<include name="${SourcePath}CMBizLib*.cs"/> 			</sources> 			<references> 				<include name="${OutputPath1}binCMDAO.dll" /> 				<include name="${OutputPath1}binCMTools.dll" /> 				<include name="${OutputPath1}binCMCommon.dll"/> 				<include name="${OutputPath1}binCMReport.dll" /> 				<include name="${OutputPath1}binCrystalDecisions.CrystalReports.Engine.dll" /> 				<include name="${OutputPath1}binCrystalDecisions.ReportSource.dll" /> 				<include name="${OutputPath1}binCrystalDecisions.Shared.dll" /> 				<include name="${OutputPath1}binCrystalDecisions.Web.dll" /> 				<include name="${OutputPath1}binCrystalDecisions.Windows.Forms.dll" /> 				<include name="${OutputPath1}binCrystalEnterpriseLib.dll" /> 				<include name="${OutputPath1}binCrystalInfoStoreLib.dll" /> 				<include name="${OutputPath1}binCrystalKeyCodeLib.dll" /> 				<include name="${OutputPath1}binCrystalPluginMgrLib.dll" /> 				<include name="${OutputPath1}binCrystalReportPluginLib.dll" /> 			</references> 		</csc> 	</target> 	<target name="CompileReport"  description="Compile all the .cs files in CMReport"> 		<csc target="library" output="${OutputPath}binCMReport.dll" doc="${OutputPath}binCMReport.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="binCrystalDecisions.Web.dll"/> 				<exclude name="binCrystalDecisions.Shared.dll"/> 				<exclude name="binCrystalDecisions.Windows.Forms.dll"/> 				<exclude name="binCrystalReportPluginLib.dll"/> 				<exclude name="binCrystalPluginMgrLib.dll"/> 				<exclude name="binCrystalKeyCodeLib.dll"/> 				<exclude name="binCrystalInfoStoreLib.dll"/> 				<exclude name="binCrystalEnterpriseLib.dll"/> 				<exclude name="binCrystalDecisions.ReportSource.dll"/> 				<exclude name="binCrystalDecisions.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="binCrystalDecisions.Web.dll"/> 				<exclude name="binCrystalDecisions.Shared.dll"/> 				<exclude name="binCrystalDecisions.Windows.Forms.dll"/> 				<exclude name="binCrystalReportPluginLib.dll"/> 				<exclude name="binCrystalPluginMgrLib.dll"/> 				<exclude name="binCrystalKeyCodeLib.dll"/> 				<exclude name="binCrystalInfoStoreLib.dll"/> 				<exclude name="binCrystalEnterpriseLib.dll"/> 				<exclude name="binCrystalDecisions.ReportSource.dll"/> 				<exclude name="binCrystalDecisions.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 off set FrameworkPath=C:WINDOWSMicrosoft.NETFrameworkv2.0.50727 set NAntPath=D:Build2010Toolsnant-0.85-binnant-0.85bin set NunitPath=D:Build2010ToolsNUnit-2.4.8-net-2.0bin set FxCopPath=D:Build2010ToolsMicrosoft FxCop 1.36  set path=%path%;%NAntPath%;% NunitPath %;% FxCopPath %;% FrameworkPath % nant -buildfile:C8.build > C8.log

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

C8.build

<?xml version="1.0" encoding="gb2312"?> <!--  Create by		: Phil Create date : 2008-7-31 Description : 这个Build文件编译WEB层,执行内容为: 				1、清空服务器上文件 				2、编译解决方案文件 				3、拷贝文件到服务器 				4、执行FxCop 				5、生成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:C8VssDBsrcsafe.ini"/> 	<property name="VSS.Path" value="$/C8/C8_New"/>  	<!-- LocalBuildFolders --> 	<property name="BasePath" value="D:Build2010"/> 	<property name="SourcePath" value="${BasePath}SourceC8_New"/> 	<property name="OutputPath" value="${BasePath}OutputC8_NewChiming.Admin.Web"/> 	<property name="OutputBinPath" value="${OutputPath}bin" />  	<property name="OutputPath1" value="${BasePath}OutputC8_NewChiming.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:Build2010PublishC8_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"> 		<vssget 			username="${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:WINDOWSMicrosoft.NETFrameworkv2.0.50727msbuild.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:BuildToolsnant-0.85-rc2bin 这个我就不知道怎么放了!

  • 点赞
  • 收藏
  • 分享

    • 文章举报

VS2003/VS2005——BUILD编译 VS2003/VS2005——BUILD编译
fenyuxiao
发布了26 篇原创文章 · 获赞 3 · 访问量 5万+

私信 关注

原文始发于:VS2003/VS2005——BUILD编译

主题测试文章,只做测试使用。发布者:sys234,转转请注明出处:http://www.cxybcw.com/64707.html

联系我们

13687733322

在线咨询:点击这里给我发消息

邮件:1877088071@qq.com

工作时间:周一至周五,9:30-18:30,节假日休息

QR code