自动编译

来源:互联网 发布:淘宝买u盘 编辑:程序博客网 时间:2024/06/03 00:07
最近一个项目递交居然要做十几个版本,手动编译光是开开关关各种选项就已经头晕,为了一劳永逸,想到了自动编译,在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

 

 

  1. rem ************************************************ 
  2. rem * Script to compile the solutions of CxImgLib * 
  3. rem * Created by:  * 
  4. rem * Created 2012.12.06                          * 
  5. rem ************************************************ 
  6.  
  7.  
  8. rem set environment variables: 
  9. set _devenv="%VS90COMNTOOLS%..\..\Common7\IDE\devenv.com" 
  10.  
  11.  
  12. rem set compile log 
  13. set _log="%~dp0compileResults.log" 
  14.  
  15. echo [%DATE% %Time%] Start compile sequence >%_log% 
  16. echo Used compile configuration is %buildAnyCPU% >>%_log% 
  17.  
  18. rem Start compile************************************************ 
  19. set _solution_file="%~dp0CxImgLib.sln" 
  20. %_devenv% %_solution_file% /build "Debug|Win32" /Out %_log% 
  21. if not %errorlevel% == 0 echo %_solution_file% failed!   Error: %errorlevel% >>%_log% 
  22. if %errorlevel% == 0 echo %_solution_file% compiled successful >>%_log% 
  23.  
  24. rem If compile failed stop processing: 
  25. if not %errorlevel% == 0 pause 
  26.  
  27. echo [%DATE% %Time%] Finished compile sequence >>%_log% 
  28.  
  29. pause

 

原创粉丝点击