编写批处理文件编译.Net工程
来源:互联网 发布:网络消费 编辑:程序博客网 时间:2024/05/29 10:47
使用随Visual Studio一块安装的devenv.com,再加上参数可以对.Net进行编译,如下
"D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com" d:\Projects\YourProject.csproj /rebuild "Release"
"D:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com" ".\Share\Projects\DGShare.sln" /rebuild Release /Out .\build_log\DGShare.log
当然,你也可以编写批处理文件来对.net的解决方案(.sln)进行编译,如下
path %path%;c:\Program Files\Microsoft Visual Studio 8\Common7\IDE
devenv.com c:\solution1\solution1.sln /rebuild "Release"
devenv.com c:\solution2\solution2.sln /rebuild "Release"
devenv.com c:\solution3\solution3.sln /rebuild "Release"
...
第一份例子
@echo off
set time1=%TIME%
dir | find "build_log" > nul
if %errorlevel%==0 goto end REM--如果有就跳到:end
if %errorlevel%==1 goto create REM--如果没就跳到:create
:create
md build_log
:end
path %path%;D:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
devenv.com ".\Share\Projects\DGShare.sln" /rebuild Debug /Out .\build_log\DGShareD.log
devenv.com ".\Taurus\Projects\Taurus.sln" /rebuild Debug /Out .\build_log\TaurusD.log
devenv.com ".\DreamStudio\Projects\DreamStudio.sln" /rebuild Debug /Out .\build_log\DreamStudioD.log
REM devenv.com ".\DreamGame\Client\Projects\DGClient.sln" /rebuild Debug /Out .\build_log\DGClientD.log
@echo off
echo 开始时间:%time1%
echo 结束时间:%TIME%
pause
第二份例子:
@echo off
:: 手动发布sdk和工具到 build 服务器(编译服务无法使用的情况下)
set build_ver=Alpha4
echo 正在更新...
echo .
echo 拷贝 SDK 库和头文件...
xcopy /y /r /s /q D:\DGSource\DG_Game\Project2009\branches\%build_ver%\Share\SDK\Include\*.* \\build\c$\Products\Output\%build_ver%\Debug\SDK\include\
xcopy /y /r /s /q D:\DGSource\DG_Game\Project2009\branches\%build_ver%\Taurus\SDK\Include\*.* \\build\c$\Products\Output\%build_ver%\Debug\SDK\include\
xcopy /y /r /s /q D:\DGSource\DG_Game\Project2009\branches\%build_ver%\Share\SDK\Include\*.* \\build\c$\Products\Output\%build_ver%\Release\SDK\include\
xcopy /y /r /s /q D:\DGSource\DG_Game\Project2009\branches\%build_ver%\Taurus\SDK\Include\*.* \\build\c$\Products\Output\%build_ver%\Release\SDK\include\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\SDK\lib\*.* \\build\c$\Products\Output\%build_ver%\Debug\SDK\lib\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\SDK\lib\*.* \\build\c$\Products\Output\%build_ver%\Release\SDK\lib\
echo 拷贝公共 COM 组件...
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\COM\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Debug\GameWorld\COM\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Debug\TaurusDebug\COM\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\COM\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Release\GameWorld\COM\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\GameWorld\COM\*.* \\build\c$\Products\Output\%build_ver%\Release\TaurusDebug\COM\
echo 拷贝编辑器等工具...
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\TaurusDebug\*.exe \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\DreamStudio\*.exe \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\DreamStudio\*.dll \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\DreamStudio\*.ocx \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Debug\DreamStudio\ModulesD\*.* \\build\c$\Products\Output\%build_ver%\Debug\DreamStudio\ModulesD\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\TaurusDebug\*.exe \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\DreamStudio\*.exe \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\DreamStudio\*.dll \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\DreamStudio\*.ocx \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
xcopy /y /r /s /q %~dp0\%build_ver%\Release\DreamStudio\Modules\*.* \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\Modules\
xcopy /y /r D:\DGSource\DG_Game\Project2009\branches\%build_ver%\DreamStudio\Projects\DreamStudio\update.ini \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
xcopy /y /r D:\DGSource\DG_Game\Project2009\branches\%build_ver%\DreamStudio\Projects\DreamStudio\update.txt \\build\c$\Products\Output\%build_ver%\Release\DreamStudio\
echo .
echo 更新完毕!
echo .
pause
- 编写批处理文件编译.Net工程
- 编译asp.net用到的批处理文件
- 批处理文件编写
- 编写批处理文件
- 批处理文件编写
- 批处理文件编写
- unity 打开工程批处理文件
- 3.2创建工程批处理文件
- .NET工程的自动化编译
- 批处理文件的编写方法
- 批处理文件的编写方法
- 批处理文件简介与编写
- 批处理文件简介与编写
- 怎么编写批处理文件
- 批处理文件的编写
- 批处理文件的编写
- 如何编写批处理文件
- 批处理文件的编写方法
- 浅谈产品界面视觉上的轻设计
- arcgis 10.1 中忘记 site的管理员密码 后的处理方式
- SNP
- android EditText 中显示Error提示的时候文字不见了
- 【技巧】批处理,Bat中获取用户输入的指定内容
- 编写批处理文件编译.Net工程
- suse 11 rhel 下载
- imx6 NFS boot
- Android 网络通信框架Volley简介(Google IO 2013)(转载自http://blog.csdn.net/t12x3456/article/details/9221611)
- struts2 18拦截器详解(九) --- ScopedModelDrivenInterceptor
- 配置本地环境之apache安装
- magento upsell from cur_category
- 那些过目不忘的无线端交互设计(DRIBBBLE GIF动态图)
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry