编写批处理文件编译.Net工程
使用随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
最新文章
- auto_ptr,shared_ptr 智能指针的使用
- 07_控制线程_join_线程插队
- Qt学习之路(34): 国际化(下)
- Centos 6.4 openNebula4
- 如何实现 Service 伸缩?- 每天5分钟玩转 Docker 容器技术(97)
- node.js安装使用express框架
- IDEA Maven项目默认编译器使用JDK1.5的解决办法
- Vue 获取元素样式 元素高度
- c# 服务
- 通过python生成nginx模板配置文件
- .14-浅析webpack源码之Watchpack模块
- 安装adt插件后工具栏不显示android相关图标
- JavaEE笔记(十三)
- Speech and Language Processing, NLP 处理
- Git_撤销修改
- 关于select的一个死循环
- [BZOJ]4650 优秀的拆分(Noi2016)(哈希+二分)
- 构造函数与普通函数关于“new”操作符
- js 实现图片无限横向滚动效果
- canvas 绘制验证码
热门文章
- 1019 General Palindromic Number (20)(20 point(s))
- JS (function (window, document, undefined) {})(window, document)的真正含义
- [USACO11DEC]Grass Planting
- Python168的学习笔记7
- PAT甲级1127. ZigZagging on a Tree
- Linux下LoadGenerator的搭建
- spring---aop(4)---Spring AOP的CGLIB动态代理
- 最小生成树-普利姆算法lazy实现
- tomcat部署应用仅需ip和port访问
- Android 手机 无线 ADB