| 1 | @setlocal |
| 2 | @pushd %~dp0 |
| 3 | |
| 4 | @set _C=Debug |
| 5 | :parse_args |
| 6 | @if /i "%1"=="release" set _C=Release |
| 7 | @if not "%1"=="" shift & goto parse_args |
| 8 | |
| 9 | @if "%VCToolsVersion%"=="" call :StartDeveloperCommandPrompt || exit /b |
| 10 | |
| 11 | @echo build %_C% |
| 12 | |
| 13 | :: Initialize required files/folders |
| 14 | |
| 15 | call build_init.cmd |
| 16 | |
| 17 | :: DTF |
| 18 | |
| 19 | call dtf\dtf.cmd %_C% || exit /b |
| 20 | |
| 21 | |
| 22 | :: internal |
| 23 | |
| 24 | call internal\internal.cmd %_C% || exit /b |
| 25 | |
| 26 | |
| 27 | :: libs |
| 28 | |
| 29 | call libs\libs.cmd %_C% || exit /b |
| 30 | |
| 31 | |
| 32 | :: api |
| 33 | |
| 34 | call api\api.cmd %_C% || exit /b |
| 35 | |
| 36 | |
| 37 | :: burn |
| 38 | |
| 39 | call burn\burn.cmd %_C% || exit /b |
| 40 | |
| 41 | |
| 42 | :: wix |
| 43 | |
| 44 | call wix\wix.cmd %_C% || exit /b |
| 45 | |
| 46 | |
| 47 | :: tools |
| 48 | |
| 49 | call tools\tools.cmd %_C% || exit /b |
| 50 | |
| 51 | |
| 52 | :: ext |
| 53 | |
| 54 | call ext\ext.cmd %_C% || exit /b |
| 55 | |
| 56 | |
| 57 | :: setup |
| 58 | |
| 59 | call setup\setup.cmd %_C% || exit /b |
| 60 | |
| 61 | |
| 62 | :: integration tests |
| 63 | |
| 64 | call test\test.cmd %_C% || exit /b |
| 65 | |
| 66 | |
| 67 | :: finalize build |
| 68 | |
| 69 | call internal\finalize.cmd %_C% || exit /b |
| 70 | |
| 71 | |
| 72 | goto LExit |
| 73 | |
| 74 | :StartDeveloperCommandPrompt |
| 75 | if not "%WixSkipVsDevCmd%"=="" ( |
| 76 | echo Skipping initializing developer command prompt |
| 77 | exit /b |
| 78 | ) |
| 79 | |
| 80 | echo Initializing developer command prompt |
| 81 | |
| 82 | if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ( |
| 83 | "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" |
| 84 | exit /b 2 |
| 85 | ) |
| 86 | |
| 87 | for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version [17.0^,18.0^) -property installationPath`) do ( |
| 88 | if exist "%%i\Common7\Tools\vsdevcmd.bat" ( |
| 89 | call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo |
| 90 | exit /b |
| 91 | ) |
| 92 | echo developer command prompt not found in %%i |
| 93 | ) |
| 94 | |
| 95 | echo No versions of developer command prompt found |
| 96 | exit /b 2 |
| 97 | |
| 98 | :LExit |
| 99 | @popd |
| 100 | @endlocal |