Skip to content

Commit fcf622e

Browse files
committed
Updates release build to collect symbols and binaries, and create nuget package.
1 parent 1ecf7d2 commit fcf622e

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

Tools/msi/buildrelease.bat

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ set BUILDX64=
3636
set TARGET=Rebuild
3737
set TESTTARGETDIR=
3838
set PGO=
39+
set BUILDNUGET=1
40+
set BUILDZIP=1
3941

4042

4143
:CheckOpts
@@ -55,6 +57,8 @@ if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
5557
if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
5658
if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
5759
if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts
60+
if "%1" EQU "--skip-nuget" (set BUILDNUGET=) && shift && goto CheckOpts
61+
if "%1" EQU "--skip-zip" (set BUILDZIP=) && shift && goto CheckOpts
5862

5963
if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1
6064

@@ -182,21 +186,31 @@ if errorlevel 1 exit /B
182186
msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild /p:Platform=%1 %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
183187
if errorlevel 1 exit /B
184188

185-
msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%
189+
if defined BUILDZIP (
190+
msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%
191+
if errorlevel 1 exit /B
192+
)
193+
194+
if defined BUILDNUGET (
195+
msbuild "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"
196+
if errorlevel 1 exit /B
197+
)
186198

187199
if not "%OUTDIR%" EQU "" (
188200
mkdir "%OUTDIR%\%OUTDIR_PLAT%"
189-
copy /Y "%BUILD%en-us\*.cab" "%OUTDIR%\%OUTDIR_PLAT%"
190-
copy /Y "%BUILD%en-us\*.exe" "%OUTDIR%\%OUTDIR_PLAT%"
191-
copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%"
192-
copy /Y "%BUILD%en-us\*.msu" "%OUTDIR%\%OUTDIR_PLAT%"
201+
mkdir "%OUTDIR%\%OUTDIR_PLAT%\binaries"
202+
mkdir "%OUTDIR%\%OUTDIR_PLAT%\symbols"
203+
robocopy "%BUILD%en-us" "%OUTDIR%\%OUTDIR_PLAT%" /XF "*.wixpdb"
204+
robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\binaries" *.exe *.dll *.pyd /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
205+
robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\symbols" *.pdb /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
193206
)
194207

195208
exit /B 0
196209

197210
:Help
198-
echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build]
199-
echo [--pgo COMMAND] [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR]
211+
echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
212+
echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip]
213+
echo [--download DOWNLOAD URL] [--test TARGETDIR]
200214
echo [-h]
201215
echo.
202216
echo --out (-o) Specify an additional output directory for installers
@@ -205,6 +219,8 @@ echo -x64 Build x64 installers
205219
echo --build (-b) Incrementally build Python rather than rebuilding
206220
echo --skip-build (-B) Do not build Python (just do the installers)
207221
echo --skip-doc (-D) Do not build documentation
222+
echo --skip-nuget Do not build Nuget packages
223+
echo --skip-zip Do not build embeddable package
208224
echo --pgo Build x64 installers using PGO
209225
echo --download Specify the full download URL for MSIs
210226
echo --test Specify the test directory to run the installer tests

Tools/msi/make_zip.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
1717
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)"</CleanCommand>
1818
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
19-
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a "$(ArchName)"</Arguments>
19+
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))"</Arguments>
2020
<Environment>set DOC_FILENAME=python$(PythonVersion).chm
2121
set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT</Environment>
2222
</PropertyGroup>

Tools/nuget/make_pkg.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
2424

2525
<PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
26-
<PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments>
26+
<PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(OutDir.TrimEnd('\'))\.."</PythonArguments>
2727

2828
<PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
2929
<PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>

0 commit comments

Comments
 (0)