blob: 464ef0456af47a790a605ffe5767194cea466222 [file] [log] [blame]
Steve Dower33f73102016-06-24 10:32:15 -07001<?xml version="1.0" encoding="utf-8"?>
2<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3 <PropertyGroup>
4 <ProjectGuid>{10487945-15D1-4092-A214-338395C4116B}</ProjectGuid>
5 <OutputName>python</OutputName>
6 <OutputName Condition="$(Platform) == 'x86'">$(OutputName)x86</OutputName>
7 <OutputSuffix></OutputSuffix>
8 <SupportSigning>false</SupportSigning>
Steve Dowere7614dd2016-06-25 16:13:30 -07009 <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
Steve Dower33f73102016-06-24 10:32:15 -070010 </PropertyGroup>
11
12 <Import Project="..\msi\msi.props" />
13
14 <PropertyGroup>
15 <Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
16 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
Steve Dower41fca9d2016-09-12 13:29:58 -070017 <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
Steve Dower33f73102016-06-24 10:32:15 -070018 <SignOutput>false</SignOutput>
19 <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
20 <TargetExt>.nupkg</TargetExt>
Steve Dower33f73102016-06-24 10:32:15 -070021 <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)</IntermediateOutputPath>
22
23 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
24
25 <PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
26 <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments>
27
Steve Dowere7614dd2016-06-25 16:13:30 -070028 <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
Steve Dower33128c82016-06-27 09:34:18 -070029 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>
Steve Dower3f9fbfc2016-06-24 11:37:50 -070030
Steve Dower33f73102016-06-24 10:32:15 -070031 <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments>
32 <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments>
Steve Dower33128c82016-06-27 09:34:18 -070033 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
Steve Dower33f73102016-06-24 10:32:15 -070034 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
35 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
36
Steve Dower360c49b2017-03-16 11:03:03 -070037 <Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
38 <Environment Condition="Exists($(CRTRedist))">$(Environment)%0D%0Aset VCREDIST_PATH=$(CRTRedist)\$(Platform)</Environment>
Steve Dower33f73102016-06-24 10:32:15 -070039 </PropertyGroup>
40
41 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
42 <Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
43 </Target>
44
45 <Target Name="_Build">
Steve Dower3f9fbfc2016-06-24 11:37:50 -070046 <Exec Command="$(CleanCommand)" />
Steve Dower360c49b2017-03-16 11:03:03 -070047 <Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)" />
Steve Dower3f9fbfc2016-06-24 11:37:50 -070048 <Exec Command="$(PipArguments)" />
Steve Dower33128c82016-06-27 09:34:18 -070049 <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" />
Steve Dower33f73102016-06-24 10:32:15 -070050 <Exec Command="$(NugetArguments)" />
51 </Target>
52
53 <Target Name="AfterBuild" />
54 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
55</Project>