VS2005——BULID编译(之前的页面显示不出来,郁闷,分开来写!) .

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

 

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

C8.bat

@echo off
set FrameworkPath=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
set NAntPath=D:\Build2010\Tools\nant-0.85-bin\nant-0.85\bin
set NunitPath=D:\Build2010\Tools\NUnit-2.4.8-net-2.0\bin
set FxCopPath=D:\Build2010\Tools\Microsoft 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:\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">
		<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:\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 这个就不好怎么弄了!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值