2017-06-10 16:58:42 -03:00
|
|
|
@echo off
|
|
|
|
setlocal
|
|
|
|
set D=%~dp0
|
2017-09-25 13:58:10 -03:00
|
|
|
set PCBUILD=%D%..\..\PCbuild\
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
set BUILDX86=
|
|
|
|
set BUILDX64=
|
2022-01-28 12:48:06 -04:00
|
|
|
set BUILDARM64=
|
2017-06-10 16:58:42 -03:00
|
|
|
set BUILDDOC=
|
2019-03-31 00:58:17 -03:00
|
|
|
set BUILDTEST=
|
2017-06-10 16:58:42 -03:00
|
|
|
set BUILDPACK=
|
|
|
|
set REBUILD=
|
|
|
|
|
|
|
|
:CheckOpts
|
|
|
|
if "%~1" EQU "-h" goto Help
|
|
|
|
if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
|
|
|
|
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
|
2022-01-28 12:48:06 -04:00
|
|
|
if "%~1" EQU "-arm64" (set BUILDARM64=1) && shift && goto CheckOpts
|
2017-06-10 16:58:42 -03:00
|
|
|
if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
|
|
|
|
if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
|
2019-03-31 00:58:17 -03:00
|
|
|
if "%~1" EQU "--test-marker" (set BUILDTEST=--test-marker) && shift && goto CheckOpts
|
2017-06-10 16:58:42 -03:00
|
|
|
if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
|
|
|
|
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
|
|
|
|
|
2022-01-28 12:48:06 -04:00
|
|
|
if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM64 (set BUILDX86=1) && (set BUILDX64=1)
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
call "%D%get_externals.bat"
|
2017-06-19 14:34:25 -03:00
|
|
|
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
|
|
|
|
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
if defined BUILDX86 (
|
2022-01-28 12:48:06 -04:00
|
|
|
call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST%
|
2017-06-10 16:58:42 -03:00
|
|
|
if errorlevel 1 goto :eof
|
2022-01-28 12:48:06 -04:00
|
|
|
call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST%
|
2017-06-10 16:58:42 -03:00
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
|
|
|
if defined BUILDX64 (
|
|
|
|
call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
2022-01-28 12:48:06 -04:00
|
|
|
if defined BUILDARM64 (
|
|
|
|
call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST%
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
if defined BUILDDOC (
|
|
|
|
call "%PCBUILD%..\Doc\make.bat" htmlhelp
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
|
|
|
|
|
|
|
rem Build the launcher MSI separately
|
2017-06-19 14:34:25 -03:00
|
|
|
%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
set BUILD_CMD="%D%bundle\snapshot.wixproj"
|
|
|
|
if defined BUILDTEST (
|
|
|
|
set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
|
|
|
|
)
|
|
|
|
if defined BUILDPACK (
|
|
|
|
set BUILD_CMD=%BUILD_CMD% /p:Pack=true
|
|
|
|
)
|
|
|
|
if defined REBUILD (
|
|
|
|
set BUILD_CMD=%BUILD_CMD% /t:Rebuild
|
|
|
|
)
|
|
|
|
|
|
|
|
if defined BUILDX86 (
|
2022-01-28 12:48:06 -04:00
|
|
|
%MSBUILD% /p:Platform=x86 %BUILD_CMD%
|
2017-06-10 16:58:42 -03:00
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
|
|
|
if defined BUILDX64 (
|
2017-06-19 14:34:25 -03:00
|
|
|
%MSBUILD% /p:Platform=x64 %BUILD_CMD%
|
2017-06-10 16:58:42 -03:00
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
2022-01-28 12:48:06 -04:00
|
|
|
if defined BUILDARM64 (
|
|
|
|
%MSBUILD% /p:Platform=ARM64 %BUILD_CMD%
|
|
|
|
if errorlevel 1 goto :eof
|
|
|
|
)
|
2017-06-10 16:58:42 -03:00
|
|
|
|
|
|
|
exit /B 0
|
|
|
|
|
|
|
|
:Help
|
2022-01-28 12:48:06 -04:00
|
|
|
echo build.bat [-x86] [-x64] [-arm64] [--doc] [-h] [--test-marker] [--pack] [-r]
|
2017-06-10 16:58:42 -03:00
|
|
|
echo.
|
|
|
|
echo -x86 Build x86 installers
|
|
|
|
echo -x64 Build x64 installers
|
2022-01-28 12:48:06 -04:00
|
|
|
echo -ARM64 Build ARM64 installers
|
2017-06-10 16:58:42 -03:00
|
|
|
echo --doc Build CHM documentation
|
2019-03-31 00:58:17 -03:00
|
|
|
echo --test-marker Build with test markers
|
|
|
|
echo --no-test-marker Build without test markers (default)
|
2017-06-10 16:58:42 -03:00
|
|
|
echo --pack Embed core MSIs into installer
|
|
|
|
echo -r Rebuild rather than incremental build
|