Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/Build.cmd @ 4867

Last change on this file since 4867 was 4863, checked in by abeham, 14 years ago

#1285

  • Added a build file that asks for some options and then calls msbuild to build the specified solution with the specified configuration and platform
File size: 1.5 KB
Line 
1@ECHO OFF
2
3SET /A COUNT=0
4FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
5  CALL :forloopbody "%%A")
6
7ECHO Found the following solutions:
8FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
9ECHO.
10SET /P SOLUTIONINDEX=Which solution to build (type the number):
11
12SET SELECTED=""
13FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
14IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B)
15
16IF %SELECTED%=="" GOTO :eof
17
18SET /P CONFIGURATION=Which configuration to build [Debug]:
19IF "%CONFIGURATION%"=="" SET CONFIGURATION=Debug
20SET /P PLATFORM=Which platform to build [Any CPU]:
21IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
22
23REM First find the path to the msbuild.exe by performing a registry query
24FOR /F "tokens=1,3 delims=   " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B
25
26REM Then execute msbuild to clean and build the solution
27REM Disable that msbuild creates a cache file of the solution
28SET MSBuildUseNoSolutionCache=1
29REM Run msbuild to clean and then build
30%MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo
31%MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo
32
33PAUSE
34
35GOTO :eof
36
37REM This workaround is necessary so that COUNT gets reevaluated
38:forloopbody
39SET /A COUNT+=1
40SET SOLUTIONS.%COUNT%=%1
41GOTO :eof
Note: See TracBrowser for help on using the repository browser.