1 :: Set up build environment and run execute msbuild with all supplied arguments.
4 :: -------------------------------------------------------
5 :: %1 Visual Studio target, build|clean, default build
6 :: %2 Host CPU architecture, x86_64|i686, default x86_64
7 :: %3 Visual Studio configuration, debug|release, default release
8 :: %4 Additional arguments passed to msbuild, needs to be quoted if multiple.
9 :: %5 Project to build.
10 :: -------------------------------------------------------
17 :: Get path for current running script.
18 set RUN_MSBUILD_SCRIPT_PATH=%~dp0
20 :: Configure all known build arguments.
22 if /i "%~1" == "clean" (
28 if /i "%~1" == "i686" (
29 set VS_PLATFORM="Win32"
31 if /i "%~1" == "win32" (
32 set VS_PLATFORM="Win32"
36 set VS_CONFIGURATION=Release
37 if /i "%~1" == "debug" (
38 set VS_CONFIGURATION="Debug"
43 if /i "%~1" == "boehm" (
44 set VS_TARGET_GC="boehm"
48 set VS_ADDITIONAL_ARGUMENTS=
50 set VS_ADDITIONAL_ARGUMENTS=%~1
54 set VS_BUILD_PROJ=mono.sln
55 if /i not "%~1" == "" (
59 if not exist %VS_BUILD_PROJ% (
60 set VS_BUILD_PROJ=%RUN_MSBUILD_SCRIPT_PATH%%VS_BUILD_PROJ%
63 :: Setup Windows environment.
64 call %RUN_MSBUILD_SCRIPT_PATH%setup-windows-env.bat
66 :: Setup VS msbuild environment.
67 call %RUN_MSBUILD_SCRIPT_PATH%setup-vs-msbuild-env.bat
69 if "%VS_ADDITIONAL_ARGUMENTS%" == "" (
70 set "VS_ADDITIONAL_ARGUMENTS=/p:PlatformToolset=%VS_DEFAULT_PLATFORM_TOOL_SET%"
73 set VS_BUILD_ARGS=/p:Configuration=%VS_CONFIGURATION% /p:Platform=%VS_PLATFORM% /p:MONO_TARGET_GC=%VS_TARGET_GC% %VS_ADDITIONAL_ARGUMENTS% /t:%VS_TARGET% /m
74 call msbuild.exe %VS_BUILD_ARGS% "%VS_BUILD_PROJ%" && (
78 if not %ERRORLEVEL% == 0 (
79 set BUILD_RESULT=%ERRORLEVEL%
83 exit /b %BUILD_RESULT%