Last change
on this file since 4866 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 |
|
---|
3 | SET /A COUNT=0
|
---|
4 | FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
|
---|
5 | CALL :forloopbody "%%A")
|
---|
6 |
|
---|
7 | ECHO Found the following solutions:
|
---|
8 | FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
|
---|
9 | ECHO.
|
---|
10 | SET /P SOLUTIONINDEX=Which solution to build (type the number):
|
---|
11 |
|
---|
12 | SET SELECTED=""
|
---|
13 | FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
|
---|
14 | IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B)
|
---|
15 |
|
---|
16 | IF %SELECTED%=="" GOTO :eof
|
---|
17 |
|
---|
18 | SET /P CONFIGURATION=Which configuration to build [Debug]:
|
---|
19 | IF "%CONFIGURATION%"=="" SET CONFIGURATION=Debug
|
---|
20 | SET /P PLATFORM=Which platform to build [Any CPU]:
|
---|
21 | IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
|
---|
22 |
|
---|
23 | REM First find the path to the msbuild.exe by performing a registry query
|
---|
24 | FOR /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 |
|
---|
26 | REM Then execute msbuild to clean and build the solution
|
---|
27 | REM Disable that msbuild creates a cache file of the solution
|
---|
28 | SET MSBuildUseNoSolutionCache=1
|
---|
29 | REM 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 |
|
---|
33 | PAUSE
|
---|
34 |
|
---|
35 | GOTO :eof
|
---|
36 |
|
---|
37 | REM This workaround is necessary so that COUNT gets reevaluated
|
---|
38 | :forloopbody
|
---|
39 | SET /A COUNT+=1
|
---|
40 | SET SOLUTIONS.%COUNT%=%1
|
---|
41 | GOTO :eof |
---|
Note: See
TracBrowser
for help on using the repository browser.