summaryrefslogtreecommitdiff
path: root/Tools/msi/buildrelease.bat
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/msi/buildrelease.bat')
-rw-r--r--Tools/msi/buildrelease.bat87
1 files changed, 38 insertions, 49 deletions
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index f296e613ac..4659a32b83 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -35,7 +35,7 @@ set BUILDX86=
set BUILDX64=
set TARGET=Rebuild
set TESTTARGETDIR=
-set PGO=
+set PGO=-m test -q --pgo
set BUILDNUGET=1
set BUILDZIP=1
@@ -57,6 +57,7 @@ if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--skip-pgo" (set PGO=) && shift && goto CheckOpts
if "%1" EQU "--skip-nuget" (set BUILDNUGET=) && shift && goto CheckOpts
if "%1" EQU "--skip-zip" (set BUILDZIP=) && shift && goto CheckOpts
@@ -109,21 +110,14 @@ exit /B 0
@echo off
if "%1" EQU "x86" (
- call "%PCBUILD%env.bat" x86
+ set PGO=
set BUILD=%PCBUILD%win32\
set BUILD_PLAT=Win32
set OUTDIR_PLAT=win32
set OBJDIR_PLAT=x86
-) else if "%~2" NEQ "" (
- call "%PCBUILD%env.bat" amd64
- set PGO=%~2
- set BUILD=%PCBUILD%amd64-pgo\
- set BUILD_PLAT=x64
- set OUTDIR_PLAT=amd64
- set OBJDIR_PLAT=x64
) else (
- call "%PCBUILD%env.bat" amd64
set BUILD=%PCBUILD%amd64\
+ set PGO=%~2
set BUILD_PLAT=x64
set OUTDIR_PLAT=amd64
set OBJDIR_PLAT=x64
@@ -135,6 +129,12 @@ if exist "%BUILD%en-us" (
if errorlevel 1 exit /B
)
+if exist "%D%obj\Debug_%OBJDIR_PLAT%" (
+ echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"
+ rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"
+ if errorlevel 1 exit /B
+)
+
if exist "%D%obj\Release_%OBJDIR_PLAT%" (
echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
@@ -146,45 +146,38 @@ if not "%CERTNAME%" EQU "" (
) else (
set CERTOPTS=
)
-
+if not "%PGO%" EQU "" (
+ set PGOOPTS=--pgo-job "%PGO%"
+) else (
+ set PGOOPTS=
+)
if not "%SKIPBUILD%" EQU "1" (
- @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%
+ @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
+ @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
@if errorlevel 1 exit /B
@rem build.bat turns echo back on, so we disable it again
@echo off
-
- if "%PGO%" EQU "" (
- @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%
- ) else (
- @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -c PGInstrument -t %TARGET% %CERTOPTS%
- @if errorlevel 1 exit /B
-
- @del "%BUILD%*.pgc"
- if "%PGO%" EQU "default" (
- "%BUILD%python.exe" -m test -q --pgo
- ) else if "%PGO%" EQU "default2" (
- "%BUILD%python.exe" -m test -r -q --pgo
- "%BUILD%python.exe" -m test -r -q --pgo
- ) else if "%PGO%" EQU "default10" (
- for /L %%i in (0, 1, 9) do "%BUILD%python.exe" -m test -q -r --pgo
- ) else if "%PGO%" EQU "pybench" (
- "%BUILD%python.exe" "%PCBUILD%..\Tools\pybench\pybench.py"
- ) else (
- "%BUILD%python.exe" %PGO%
- )
-
- @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -c PGUpdate -t Build %CERTOPTS%
- )
+
+ @echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
+ @call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
@if errorlevel 1 exit /B
+ @rem build.bat turns echo back on, so we disable it again
@echo off
)
-set BUILDOPTS=/p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
-if "%PGO%" NEQ "" set BUILDOPTS=%BUILDOPTS% /p:PGOBuildPath=%BUILD%
-msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
-msbuild "%D%bundle\releaselocal.wixproj" /t:Rebuild /p:Platform=%1 %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
+call "%PCBUILD%env.bat"
+if "%OUTDIR_PLAT%" EQU "win32" (
+ msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
+ if errorlevel 1 exit /B
+) else if not exist "%PCBUILD%win32\en-us\launcher.msi" (
+ msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
+ if errorlevel 1 exit /B
+)
+
+set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
+msbuild "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
if errorlevel 1 exit /B
-msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild /p:Platform=%1 %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
+msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
if errorlevel 1 exit /B
if defined BUILDZIP (
@@ -210,7 +203,7 @@ exit /B 0
:Help
echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
-echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip]
+echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip] [--skip-pgo]
echo [--download DOWNLOAD URL] [--test TARGETDIR]
echo [-h]
echo.
@@ -220,9 +213,10 @@ echo -x64 Build x64 installers
echo --build (-b) Incrementally build Python rather than rebuilding
echo --skip-build (-B) Do not build Python (just do the installers)
echo --skip-doc (-D) Do not build documentation
+echo --pgo Specify PGO command for x64 installers
+echo --skip-pgo Build x64 installers without using PGO
echo --skip-nuget Do not build Nuget packages
echo --skip-zip Do not build embeddable package
-echo --pgo Build x64 installers using PGO
echo --download Specify the full download URL for MSIs
echo --test Specify the test directory to run the installer tests
echo -h Display this help information
@@ -230,13 +224,8 @@ echo.
echo If no architecture is specified, all architectures will be built.
echo If --test is not specified, the installer tests are not run.
echo.
-echo For the --pgo option, any Python command line can be used as well as the
-echo following shortcuts:
-echo Shortcut Description
-echo default Test suite with --pgo
-echo default2 2x test suite with --pgo and randomized test order
-echo default10 10x test suite with --pgo and randomized test order
-echo pybench pybench script
+echo For the --pgo option, any Python command line can be used, or 'default' to
+echo use the default task (-m test --pgo).
echo.
echo The following substitutions will be applied to the download URL:
echo Variable Description Example