• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1@echo off
2setlocal
3set D=%~dp0
4set PCBUILD=%D%..\..\PCbuild\
5
6set BUILDX86=
7set BUILDX64=
8set BUILDDOC=
9set BUILDTEST=
10set BUILDPACK=
11set REBUILD=
12
13:CheckOpts
14if "%~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
18if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
19if "%~1" EQU "--test-marker" (set BUILDTEST=--test-marker) && shift && goto CheckOpts
20if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
21if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
22
23if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
24
25call "%D%get_externals.bat"
26call "%PCBUILD%find_msbuild.bat" %MSBUILD%
27if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
28
29if defined BUILDX86 (
30    call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
31    if errorlevel 1 goto :eof
32    call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
33    if errorlevel 1 goto :eof
34)
35if defined BUILDX64 (
36    call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
37    if errorlevel 1 goto :eof
38    call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
39    if errorlevel 1 goto :eof
40)
41
42if defined BUILDDOC (
43    call "%PCBUILD%..\Doc\make.bat" htmlhelp
44    if errorlevel 1 goto :eof
45)
46
47rem Build the launcher MSI separately
48%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86
49
50set BUILD_CMD="%D%bundle\snapshot.wixproj"
51if defined BUILDTEST (
52    set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
53)
54if defined BUILDPACK (
55    set BUILD_CMD=%BUILD_CMD% /p:Pack=true
56)
57if defined REBUILD (
58    set BUILD_CMD=%BUILD_CMD% /t:Rebuild
59)
60
61if defined BUILDX86 (
62    %MSBUILD% %BUILD_CMD%
63    if errorlevel 1 goto :eof
64)
65if defined BUILDX64 (
66    %MSBUILD% /p:Platform=x64 %BUILD_CMD%
67    if errorlevel 1 goto :eof
68)
69
70exit /B 0
71
72:Help
73echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker] [--pack] [-r]
74echo.
75echo    -x86                Build x86 installers
76echo    -x64                Build x64 installers
77echo    --doc               Build CHM documentation
78echo    --test-marker       Build with test markers
79echo    --no-test-marker    Build without test markers (default)
80echo    --pack              Embed core MSIs into installer
81echo    -r                  Rebuild rather than incremental build
82