BASE_NAME = 'python{0.major}{0.minor}'.format(sys.version_info)
FULL_LAYOUT = [
- ('/', 'PCBuild/$arch', 'python.exe', is_not_debug),
- ('/', 'PCBuild/$arch', 'pythonw.exe', is_not_debug),
- ('/', 'PCBuild/$arch', 'python{}.dll'.format(sys.version_info.major), is_not_debug),
- ('/', 'PCBuild/$arch', '{}.dll'.format(BASE_NAME), is_not_debug),
- ('DLLs/', 'PCBuild/$arch', '*.pyd', is_not_debug),
- ('DLLs/', 'PCBuild/$arch', '*.dll', is_not_debug_or_python),
+ ('/', '$build', 'python.exe', is_not_debug),
+ ('/', '$build', 'pythonw.exe', is_not_debug),
+ ('/', '$build', 'python{}.dll'.format(sys.version_info.major), is_not_debug),
+ ('/', '$build', '{}.dll'.format(BASE_NAME), is_not_debug),
+ ('DLLs/', '$build', '*.pyd', is_not_debug),
+ ('DLLs/', '$build', '*.dll', is_not_debug_or_python),
('include/', 'include', '*.h', None),
('include/', 'PC', 'pyconfig.h', None),
('Lib/', 'Lib', '**/*', include_in_lib),
- ('libs/', 'PCBuild/$arch', '*.lib', include_in_libs),
+ ('libs/', '$build', '*.lib', include_in_libs),
('Tools/', 'Tools', '**/*', include_in_tools),
]
EMBED_LAYOUT = [
- ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug),
- ('/', 'PCBuild/$arch', '*.pyd', is_not_debug),
- ('/', 'PCBuild/$arch', '*.dll', is_not_debug),
+ ('/', '$build', 'python*.exe', is_not_debug),
+ ('/', '$build', '*.pyd', is_not_debug),
+ ('/', '$build', '*.dll', is_not_debug),
('{}.zip'.format(BASE_NAME), 'Lib', '**/*', include_in_embeddable_lib),
]
parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None)
parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None)
parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False)
- parser.add_argument('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32")
+ parser.add_argument('-b', '--build', help='Specify the build directory', type=Path, default=None)
ns = parser.parse_args()
source = ns.source or (Path(__file__).resolve().parent.parent.parent)
out = ns.out
- arch = ns.arch
+ build = ns.build or Path(sys.exec_prefix)
assert isinstance(source, Path)
assert not out or isinstance(out, Path)
- assert isinstance(arch, str)
+ assert isinstance(build, Path)
if ns.temp:
temp = ns.temp
try:
for t, s, p, c in layout:
- fs = source / s.replace("$arch", arch)
+ if s == '$build':
+ fs = build
+ else:
+ fs = source / s
files = rglob(fs, p, c)
extra_files = []
if s == 'Lib' and p == '**/*':
<ProjectGuid>{10487945-15D1-4092-A214-338395C4116B}</ProjectGuid>
<OutputName>python</OutputName>
<OutputName Condition="$(Platform) == 'x86'">$(OutputName)x86</OutputName>
+ <OutputName Condition="$(BuildForDaily) == 'true'">$(OutputName)daily</OutputName>
<OutputSuffix></OutputSuffix>
<SupportSigning>false</SupportSigning>
<BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
<Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
<NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
<NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
+ <NuspecVersion Condition="$(BuildForDaily) == 'true'">$(MajorVersionNumber).$(MinorVersionNumber).$(DailyBuildVersion)</NuspecVersion>
<SignOutput>false</SignOutput>
<TargetName>$(OutputName).$(NuspecVersion)</TargetName>
<TargetExt>.nupkg</TargetExt>
<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 "$(BuildPath.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>
<NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
<Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
+ <Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
<Environment Condition="Exists($(CRTRedist))">$(Environment)%0D%0Aset VCREDIST_PATH=$(CRTRedist)\$(Platform)</Environment>
+ <Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" >nul 2>nul</Environment>
</PropertyGroup>
<Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">