最近一个项目递交居然要做十几个版本,手动编译光是开开关关各种选项就已经头晕,为了一劳永逸,想到了自动编译,在VS2005下面提供了devenv.com命令行方式,我们可以从VS安装目录../Microsoft Visual Studio 8/Common7/IDE下面找到它,以下是几个常见用法:
Clear某个工程:
devenv.com MyTest.vcproj /clean "Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
编译某个工程:
devenv.com MyTest.vcproj /build "Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
获取帮助信息
devenv.com –h
- rem ************************************************
- rem * Script to compile the solutions of CxImgLib *
- rem * Created by: *
- rem * Created 2012.12.06 *
- rem ************************************************
- rem set environment variables:
- set _devenv="%VS90COMNTOOLS%..\..\Common7\IDE\devenv.com"
- rem set compile log
- set _log="%~dp0compileResults.log"
- echo [%DATE% %Time%] Start compile sequence >%_log%
- echo Used compile configuration is %buildAnyCPU% >>%_log%
- rem Start compile************************************************
- set _solution_file="%~dp0CxImgLib.sln"
- %_devenv% %_solution_file% /build "Debug|Win32" /Out %_log%
- if not %errorlevel% == 0 echo %_solution_file% failed! Error: %errorlevel% >>%_log%
- if %errorlevel% == 0 echo %_solution_file% compiled successful >>%_log%
- rem If compile failed stop processing:
- if not %errorlevel% == 0 pause
- echo [%DATE% %Time%] Finished compile sequence >>%_log%
- pause