diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-02-08 06:20:48 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-02-08 06:20:48 (GMT) |
commit | 312cef086b277c6f79cde5b345f0ce1ada81095e (patch) | |
tree | 96d83f36c19c961e691092841b79b73bd6ae5b13 /Tools/msi/buildrelease.bat | |
parent | 914db0f11cae7874b1e58f170ef033f157cf45e5 (diff) | |
download | cpython-312cef086b277c6f79cde5b345f0ce1ada81095e.zip cpython-312cef086b277c6f79cde5b345f0ce1ada81095e.tar.gz cpython-312cef086b277c6f79cde5b345f0ce1ada81095e.tar.bz2 |
Improve Windows release scripts
Diffstat (limited to 'Tools/msi/buildrelease.bat')
-rw-r--r-- | Tools/msi/buildrelease.bat | 51 |
1 files changed, 37 insertions, 14 deletions
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index 7183a84..3f2a94a 100644 --- a/Tools/msi/buildrelease.bat +++ b/Tools/msi/buildrelease.bat @@ -26,15 +26,21 @@ set TESTTARGETDIR= :CheckOpts +if "%1" EQU "-h" goto Help if "%1" EQU "-c" (set CERTNAME=%~2) && shift && shift && goto CheckOpts +if "%1" EQU "--certificate" (set CERTNAME=%~2) && shift && shift && goto CheckOpts if "%1" EQU "-o" (set OUTDIR=%~2) && shift && shift && goto CheckOpts +if "%1" EQU "--out" (set OUTDIR=%~2) && shift && shift && goto CheckOpts if "%1" EQU "-D" (set SKIPDOC=1) && shift && goto CheckOpts +if "%1" EQU "--skip-doc" (set SKIPDOC=1) && shift && goto CheckOpts if "%1" EQU "-B" (set SKIPBUILD=1) && shift && goto CheckOpts +if "%1" EQU "--skip-build" (set SKIPBUILD=1) && shift && goto CheckOpts if "%1" EQU "--download" (set DOWNLOAD_URL=%~2) && shift && shift && goto CheckOpts if "%1" EQU "--test" (set TESTTARGETDIR=%~2) && shift && shift && goto CheckOpts if "%1" EQU "-b" (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 "--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 not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1) @@ -42,21 +48,21 @@ if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX6 if "%SKIPBUILD%" EQU "1" goto skipdoc if "%SKIPDOC%" EQU "1" goto skipdoc +if not defined PYTHON where py -q || echo Cannot find py on path and PYTHON is not set. && exit /B 1 +if not defined SPHINXBUILD where sphinx-build -q || echo Cannot find sphinx-build on path and SPHINXBUILD is not set. && exit /B 1 call "%D%..\..\doc\make.bat" htmlhelp if errorlevel 1 goto :eof :skipdoc -where hg >nul 2>nul -if errorlevel 1 echo Cannot find hg on PATH & exit /B 1 - -where dlltool 2>nul >"%TEMP%\dlltool.loc" -if errorlevel 1 dir "%D%..\..\externals\dlltool.exe" /s/b > "%TEMP%\dlltool.loc" -if errorlevel 1 echo Cannot find binutils on PATH or in externals & exit /B 1 -set /P DLLTOOL= < "%TEMP%\dlltool.loc" -set PATH=%PATH%;%DLLTOOL:~,-12% -set DLLTOOL= -del "%TEMP%\dlltool.loc" +where hg /q || echo Cannot find Mercurial on PATH && exit /B 1 +where dlltool /q && goto skipdlltoolsearch +set _DLLTOOL_PATH= +where /R "%D%..\..\externals" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc" +if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1 +for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf +set _DLLTOOL_PATH= +:skipdlltoolsearch if defined BUILDX86 ( call :build x86 @@ -94,14 +100,12 @@ if "%1" EQU "x86" ( set RELEASE_URI=%RELEASE_URI_X64% ) -echo on if exist "%BUILD%en-us" ( echo Deleting %BUILD%en-us rmdir /q/s "%BUILD%en-us" if errorlevel 1 exit /B ) -echo on if exist "%D%obj\Release_%OBJDIR_PLAT%" ( echo Deleting "%D%obj\Release_%OBJDIR_PLAT%" rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%" @@ -138,3 +142,22 @@ if not "%OUTDIR%" EQU "" ( copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%" ) +exit /B 0 + +:Help +echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build] +echo [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR] [-h] +echo. +echo --out (-o) Specify an additional output directory for installers +echo -x86 Build x86 installers +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 --download Specify the full download URL for MSIs (should include {2}) +echo --test Specify the test directory to run the installer tests +echo -h Display this help information +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.
\ No newline at end of file |