Changeset 4919
- Timestamp:
- 11/24/10 10:02:56 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/Build.cmd
r4873 r4919 1 1 @ECHO OFF 2 2 3 SET CLEANBEFOREBUILD=1 4 5 SET SELECTED= 6 SET CONFIGURATION= 7 SET PLATFORM= 8 9 IF "%~1"=="" GOTO :prompt_solution 10 11 SET SELECTED=%1 12 IF NOT EXIST %SELECTED% ( 13 ECHO Solution file %SELECTED% could not be found. 14 GOTO :end 15 ) 16 ECHO Building solution %SELECTED% ... 17 GOTO :config_selection 18 19 :prompt_solution 3 20 SET /A COUNT=0 4 21 FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO ( 5 CALL :forloopbody "%%A") 22 CALL :forloopbody "%%A" 23 ) 6 24 7 25 IF "%COUNT%"=="1" ( 8 26 SET SELECTED=%SOLUTIONS.1% 9 27 ECHO Building %SOLUTIONS.1% as it is the only solution that was found ... 10 GOTO :config_platform_selection) 28 GOTO :config_selection 29 ) 11 30 12 31 ECHO Found the following solutions: 13 32 FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B 14 33 ECHO. 15 SET /P SOLUTIONINDEX=Which solution to build (type the number):34 SET /P SOLUTIONINDEX=Which solution to build? Type the number: 16 35 17 36 SET SELECTED="" 18 37 FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ( 19 IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B) 38 IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B 39 ) 20 40 21 41 IF %SELECTED%=="" GOTO :eof 22 42 23 :config_platform_selection 43 :config_selection 44 IF "%~2"=="" GOTO :prompt_config 45 46 SET CONFIGURATION=%~2 47 ECHO Building configuration %CONFIGURATION% ... 48 GOTO :platform_selection 49 50 :prompt_config 24 51 SET /P CONFIGURATION=Which configuration to build [Debug]: 25 52 IF "%CONFIGURATION%"=="" SET CONFIGURATION=Debug 53 54 :platform_selection 55 IF "%~3"=="" GOTO :prompt_platform 56 57 SET PLATFORM=%~3 58 ECHO Building platform %PLATFORM% ... 59 GOTO :main 60 61 :prompt_platform 26 62 SET /P PLATFORM=Which platform to build [Any CPU]: 27 63 IF "%PLATFORM%"=="" SET PLATFORM=Any CPU 28 64 65 :main 29 66 REM First find the path to the msbuild.exe by performing a registry query 30 67 FOR /F "tokens=1,3 delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO ( … … 35 72 SET MSBuildUseNoSolutionCache=1 36 73 REM Run msbuild to clean and then build 37 %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo 74 IF "%CLEANBEFOREBUILD%"=="1" ( 75 %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo 76 ) 38 77 %MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo 78 79 :end 39 80 40 81 PAUSE
Note: See TracChangeset
for help on using the changeset viewer.