vs的编译
http://hi.baidu.com/xslug/blog/item/35b0b09a1859f8a0c9eaf499.html
derry大牛有一个自动编译的脚本,灰常好用,研究了一下原理,做了点扩展 1.在命令行里使用devenv call "D:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 看实现,实际上是修改当前进程的一些环境变量,修改后就可以直接使用devenv,调用命令行了 2.build|rebuild devenv /build ConfigName [/project ProjName] [/projectconfig ConfigName] SolutionName devenv /rebuild ConfigName [/project ProjName] [/projectconfig ConfigName] SolutionName devenv /rebuild debug "c:\visual studio projects\MySolution.sln" 这样实现自动编译就没问题了 3.svn update svn up k:\svn\src 如果有多个目录可以写到svn_up.cmd里 4.sln prj参数化 利用强大的for命令 5.合并 把如下的cmd放到延迟启动里,再加上bios里设置自动开机,每天早上就能直接看到build结果和直接就能够运行的二进制文件了 call svn_up.cmd
call "D:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 @set prjdir=k:\svn\src\prj @del /q build_*.txt @del /q error*.txt
rem build by sln for /f "eol=;" %%i in (sln.lst) do ( echo build %%i devenv /build release "%prjdir%\%%i.sln" >>build_%%i.txt grep "error" build_%%i.txt >>error_%%i.txt type error_%%i.txt >>error.txt ) rem build by prj for /f "eol=;tokens=1,2*" %%i in (prj.lst) do ( echo build %%i\%%j devenv /build release /project %%j "%prjdir%\%%i.sln" >>build_%%i_%%j.txt grep "error" build_%%i_%%j.txt >>error_%%i_%%j.txt type error_%%i_%%j.txt >>error.txt ) grep -v "0 error(s)" error.txt >> error2.txt echo build done:) start error2.txt pause |