Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4919


Ignore:
Timestamp:
11/24/10 10:02:56 (13 years ago)
Author:
abeham
Message:

#1285

  • Updated batch file to run in non-interactive mode when specifying all command line parameters
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/Build.cmd

    r4873 r4919  
    11@ECHO OFF
    22
     3SET CLEANBEFOREBUILD=1
     4
     5SET SELECTED=
     6SET CONFIGURATION=
     7SET PLATFORM=
     8
     9IF "%~1"=="" GOTO :prompt_solution
     10
     11SET SELECTED=%1
     12IF NOT EXIST %SELECTED% (
     13  ECHO Solution file %SELECTED% could not be found.
     14  GOTO :end
     15)
     16ECHO Building solution %SELECTED% ...
     17GOTO :config_selection
     18
     19:prompt_solution
    320SET /A COUNT=0
    421FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
    5   CALL :forloopbody "%%A")
     22  CALL :forloopbody "%%A"
     23)
    624
    725IF "%COUNT%"=="1" (
    826  SET SELECTED=%SOLUTIONS.1%
    927  ECHO Building %SOLUTIONS.1% as it is the only solution that was found ...
    10   GOTO :config_platform_selection)
     28  GOTO :config_selection
     29)
    1130
    1231ECHO Found the following solutions:
    1332FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
    1433ECHO.
    15 SET /P SOLUTIONINDEX=Which solution to build (type the number):
     34SET /P SOLUTIONINDEX=Which solution to build? Type the number:
    1635
    1736SET SELECTED=""
    1837FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
    19 IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B)
     38  IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B
     39)
    2040
    2141IF %SELECTED%=="" GOTO :eof
    2242
    23 :config_platform_selection
     43:config_selection
     44IF "%~2"==""  GOTO :prompt_config
     45
     46SET CONFIGURATION=%~2
     47ECHO Building configuration %CONFIGURATION% ...
     48GOTO :platform_selection
     49
     50:prompt_config
    2451SET /P CONFIGURATION=Which configuration to build [Debug]:
    2552IF "%CONFIGURATION%"=="" SET CONFIGURATION=Debug
     53
     54:platform_selection
     55IF "%~3"=="" GOTO :prompt_platform
     56 
     57SET PLATFORM=%~3
     58ECHO Building platform %PLATFORM% ...
     59GOTO :main
     60
     61:prompt_platform
    2662SET /P PLATFORM=Which platform to build [Any CPU]:
    2763IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
    2864
     65:main
    2966REM First find the path to the msbuild.exe by performing a registry query
    3067FOR /F "tokens=1,3 delims=   " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
     
    3572SET MSBuildUseNoSolutionCache=1
    3673REM Run msbuild to clean and then build
    37 %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo
     74IF "%CLEANBEFOREBUILD%"=="1" (
     75  %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo
     76)
    3877%MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /nologo
     78
     79:end
    3980
    4081PAUSE
Note: See TracChangeset for help on using the changeset viewer.