]> granicus.if.org Git - python/commitdiff
Updates release build to collect symbols and binaries, and create nuget package.
authorSteve Dower <steve.dower@microsoft.com>
Thu, 27 Oct 2016 19:08:45 +0000 (12:08 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Thu, 27 Oct 2016 19:08:45 +0000 (12:08 -0700)
Tools/msi/buildrelease.bat
Tools/msi/make_zip.proj
Tools/nuget/make_pkg.proj

index e8da3ec22b00f5bdd2dd0fcc906a7d60decfdedd..1fa2dcb53407a7227b9b42319fab262cf1e44a82 100644 (file)
@@ -36,6 +36,8 @@ set BUILDX64=
 set TARGET=Rebuild\r
 set TESTTARGETDIR=\r
 set PGO=\r
+set BUILDNUGET=1\r
+set BUILDZIP=1\r
 \r
 \r
 :CheckOpts\r
@@ -55,6 +57,8 @@ if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
 if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts\r
 if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts\r
 if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts\r
+if "%1" EQU "--skip-nuget" (set BUILDNUGET=) && shift && goto CheckOpts\r
+if "%1" EQU "--skip-zip" (set BUILDZIP=) && shift && goto CheckOpts\r
 \r
 if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1\r
 \r
@@ -182,21 +186,31 @@ if errorlevel 1 exit /B
 msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild /p:Platform=%1 %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false\r
 if errorlevel 1 exit /B\r
 \r
-msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%\r
+if defined BUILDZIP (\r
+    msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%\r
+    if errorlevel 1 exit /B\r
+)\r
+\r
+if defined BUILDNUGET (\r
+    msbuild "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"\r
+    if errorlevel 1 exit /B\r
+)\r
 \r
 if not "%OUTDIR%" EQU "" (\r
     mkdir "%OUTDIR%\%OUTDIR_PLAT%"\r
-    copy /Y "%BUILD%en-us\*.cab" "%OUTDIR%\%OUTDIR_PLAT%"\r
-    copy /Y "%BUILD%en-us\*.exe" "%OUTDIR%\%OUTDIR_PLAT%"\r
-    copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%"\r
-    copy /Y "%BUILD%en-us\*.msu" "%OUTDIR%\%OUTDIR_PLAT%"\r
+    mkdir "%OUTDIR%\%OUTDIR_PLAT%\binaries"\r
+    mkdir "%OUTDIR%\%OUTDIR_PLAT%\symbols"\r
+    robocopy "%BUILD%en-us" "%OUTDIR%\%OUTDIR_PLAT%" /XF "*.wixpdb"\r
+    robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\binaries" *.exe *.dll *.pyd /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"\r
+    robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\symbols" *.pdb              /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"\r
 )\r
 \r
 exit /B 0\r
 \r
 :Help\r
-echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build]\r
-echo                  [--pgo COMMAND] [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR]\r
+echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]\r
+echo                  [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip]\r
+echo                  [--download DOWNLOAD URL] [--test TARGETDIR]\r
 echo                  [-h]\r
 echo.\r
 echo    --out (-o)          Specify an additional output directory for installers\r
@@ -205,6 +219,8 @@ echo    -x64                Build x64 installers
 echo    --build (-b)        Incrementally build Python rather than rebuilding\r
 echo    --skip-build (-B)   Do not build Python (just do the installers)\r
 echo    --skip-doc (-D)     Do not build documentation\r
+echo    --skip-nuget        Do not build Nuget packages\r
+echo    --skip-zip          Do not build embeddable package\r
 echo    --pgo               Build x64 installers using PGO\r
 echo    --download          Specify the full download URL for MSIs\r
 echo    --test              Specify the test directory to run the installer tests\r
index c411a48c1bc6defda06226e90311332e51e78435..13f75ba84931db9c6666af02e65f20260eab8529 100644 (file)
@@ -16,7 +16,7 @@
         <TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
         <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)"</CleanCommand>
         <Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
-        <Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a "$(ArchName)"</Arguments>
+        <Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))"</Arguments>
         <Environment>set DOC_FILENAME=python$(PythonVersion).chm
 set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT</Environment>
     </PropertyGroup>
index 542bf0742d793b5f1c1baa4e9cfa2472bb2fb10b..96f54dc9fc424c46640586b2e9c246bf32a5de18 100644 (file)
@@ -23,7 +23,7 @@
         <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
         
         <PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
-        <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments>
+        <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(OutDir.TrimEnd('\'))\.."</PythonArguments>
         
         <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
         <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>