Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 1 | @echo off
|
| 2 | setlocal
|
| 3 | set D=%~dp0
|
| 4 | set PCBUILD=%D%..\..\PCBuild\
|
| 5 |
|
| 6 | set BUILDX86=
|
| 7 | set BUILDX64=
|
| 8 | set BUILDDOC=
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 9 | set BUILDTEST=--test-marker
|
Steve Dower | e6894d6 | 2015-08-15 14:38:16 -0700 | [diff] [blame] | 10 | set BUILDPACK=
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 11 | set REBUILD=
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 12 |
|
| 13 | :CheckOpts
|
Steve Dower | 4943749 | 2015-07-08 20:18:44 -0700 | [diff] [blame] | 14 | if "%~1" EQU "-h" goto Help
|
| 15 | if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
|
| 16 | if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
|
| 17 | if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 18 | if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
|
Steve Dower | e6894d6 | 2015-08-15 14:38:16 -0700 | [diff] [blame] | 19 | if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 20 | if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 21 |
|
| 22 | if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
|
| 23 |
|
Steve Dower | d28a8a9 | 2015-10-23 09:50:49 -0700 | [diff] [blame] | 24 | call "%D%get_externals.bat"
|
| 25 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 26 | call "%PCBUILD%env.bat" x86
|
| 27 |
|
| 28 | if defined BUILDX86 (
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 29 | call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 30 | if errorlevel 1 goto :eof
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 31 | call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 32 | if errorlevel 1 goto :eof
|
| 33 | )
|
| 34 | if defined BUILDX64 (
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 35 | call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 36 | if errorlevel 1 goto :eof
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 37 | call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 38 | if errorlevel 1 goto :eof
|
| 39 | )
|
| 40 |
|
| 41 | if defined BUILDDOC (
|
| 42 | call "%PCBUILD%..\Doc\make.bat" htmlhelp
|
| 43 | if errorlevel 1 goto :eof
|
| 44 | )
|
| 45 |
|
Steve Dower | fb4a96a | 2016-09-22 17:07:56 -0700 | [diff] [blame] | 46 | rem Build the launcher MSI separately
|
| 47 | msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86
|
| 48 |
|
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 49 | set BUILD_CMD="%D%bundle\snapshot.wixproj"
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 50 | if defined BUILDTEST (
|
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 51 | set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
|
| 52 | )
|
Steve Dower | e6894d6 | 2015-08-15 14:38:16 -0700 | [diff] [blame] | 53 | if defined BUILDPACK (
|
| 54 | set BUILD_CMD=%BUILD_CMD% /p:Pack=true
|
| 55 | )
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 56 | if defined REBUILD (
|
| 57 | set BUILD_CMD=%BUILD_CMD% /t:Rebuild
|
| 58 | )
|
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 59 |
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 60 | if defined BUILDX86 (
|
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 61 | msbuild %BUILD_CMD%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 62 | if errorlevel 1 goto :eof
|
| 63 | )
|
| 64 | if defined BUILDX64 (
|
Steve Dower | 2237bdc | 2015-07-16 16:33:55 -0700 | [diff] [blame] | 65 | msbuild /p:Platform=x64 %BUILD_CMD%
|
Zachary Ware | 774ac37 | 2015-04-13 12:11:40 -0500 | [diff] [blame] | 66 | if errorlevel 1 goto :eof
|
| 67 | )
|
Steve Dower | 06606e7 | 2015-07-04 11:48:37 -0700 | [diff] [blame] | 68 |
|
| 69 | exit /B 0
|
| 70 |
|
| 71 | :Help
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 72 | echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r]
|
Steve Dower | 06606e7 | 2015-07-04 11:48:37 -0700 | [diff] [blame] | 73 | echo.
|
| 74 | echo -x86 Build x86 installers
|
| 75 | echo -x64 Build x64 installers
|
| 76 | echo --doc Build CHM documentation
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 77 | echo --no-test-marker Build without test markers
|
Steve Dower | e6894d6 | 2015-08-15 14:38:16 -0700 | [diff] [blame] | 78 | echo --pack Embed core MSIs into installer
|
Steve Dower | 940f6a8 | 2015-10-31 12:17:11 -0700 | [diff] [blame] | 79 | echo -r Rebuild rather than incremental build
|