blob: 69f00c0bb43f84dded3c604ee2d3614a843e5703 [file] [log] [blame]
Zachary Ware774ac372015-04-13 12:11:40 -05001@echo off
2setlocal
3set D=%~dp0
4set PCBUILD=%D%..\..\PCBuild\
5
6set BUILDX86=
7set BUILDX64=
8set BUILDDOC=
Steve Dower940f6a82015-10-31 12:17:11 -07009set BUILDTEST=--test-marker
Steve Dowere6894d62015-08-15 14:38:16 -070010set BUILDPACK=
Steve Dower940f6a82015-10-31 12:17:11 -070011set REBUILD=
Zachary Ware774ac372015-04-13 12:11:40 -050012
13:CheckOpts
Steve Dower49437492015-07-08 20:18:44 -070014if "%~1" EQU "-h" goto Help
15if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
16if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
17if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
Steve Dower940f6a82015-10-31 12:17:11 -070018if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
Steve Dowere6894d62015-08-15 14:38:16 -070019if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
Steve Dower940f6a82015-10-31 12:17:11 -070020if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
Zachary Ware774ac372015-04-13 12:11:40 -050021
22if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
23
Steve Dowerd28a8a92015-10-23 09:50:49 -070024call "%D%get_externals.bat"
25
Zachary Ware774ac372015-04-13 12:11:40 -050026call "%PCBUILD%env.bat" x86
27
28if defined BUILDX86 (
Steve Dower940f6a82015-10-31 12:17:11 -070029 call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
Zachary Ware774ac372015-04-13 12:11:40 -050030 if errorlevel 1 goto :eof
Steve Dower940f6a82015-10-31 12:17:11 -070031 call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
Zachary Ware774ac372015-04-13 12:11:40 -050032 if errorlevel 1 goto :eof
33)
34if defined BUILDX64 (
Steve Dower940f6a82015-10-31 12:17:11 -070035 call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
Zachary Ware774ac372015-04-13 12:11:40 -050036 if errorlevel 1 goto :eof
Steve Dower940f6a82015-10-31 12:17:11 -070037 call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
Zachary Ware774ac372015-04-13 12:11:40 -050038 if errorlevel 1 goto :eof
39)
40
41if defined BUILDDOC (
42 call "%PCBUILD%..\Doc\make.bat" htmlhelp
43 if errorlevel 1 goto :eof
44)
45
Steve Dowerfb4a96a2016-09-22 17:07:56 -070046rem Build the launcher MSI separately
47msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86
48
Steve Dower2237bdc2015-07-16 16:33:55 -070049set BUILD_CMD="%D%bundle\snapshot.wixproj"
Steve Dower940f6a82015-10-31 12:17:11 -070050if defined BUILDTEST (
Steve Dower2237bdc2015-07-16 16:33:55 -070051 set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
52)
Steve Dowere6894d62015-08-15 14:38:16 -070053if defined BUILDPACK (
54 set BUILD_CMD=%BUILD_CMD% /p:Pack=true
55)
Steve Dower940f6a82015-10-31 12:17:11 -070056if defined REBUILD (
57 set BUILD_CMD=%BUILD_CMD% /t:Rebuild
58)
Steve Dower2237bdc2015-07-16 16:33:55 -070059
Zachary Ware774ac372015-04-13 12:11:40 -050060if defined BUILDX86 (
Steve Dower2237bdc2015-07-16 16:33:55 -070061 msbuild %BUILD_CMD%
Zachary Ware774ac372015-04-13 12:11:40 -050062 if errorlevel 1 goto :eof
63)
64if defined BUILDX64 (
Steve Dower2237bdc2015-07-16 16:33:55 -070065 msbuild /p:Platform=x64 %BUILD_CMD%
Zachary Ware774ac372015-04-13 12:11:40 -050066 if errorlevel 1 goto :eof
67)
Steve Dower06606e72015-07-04 11:48:37 -070068
69exit /B 0
70
71:Help
Steve Dower940f6a82015-10-31 12:17:11 -070072echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r]
Steve Dower06606e72015-07-04 11:48:37 -070073echo.
74echo -x86 Build x86 installers
75echo -x64 Build x64 installers
76echo --doc Build CHM documentation
Steve Dower940f6a82015-10-31 12:17:11 -070077echo --no-test-marker Build without test markers
Steve Dowere6894d62015-08-15 14:38:16 -070078echo --pack Embed core MSIs into installer
Steve Dower940f6a82015-10-31 12:17:11 -070079echo -r Rebuild rather than incremental build