1<?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        <OutputName Condition="$(BuildForDaily) == 'true'">$(OutputName)daily</OutputName>
8        <OutputSuffix></OutputSuffix>
9        <SupportSigning>false</SupportSigning>
10        <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
11    </PropertyGroup>
12
13    <Import Project="..\msi\msi.props" />
14
15    <PropertyGroup>
16        <Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
17        <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
18        <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
19        <NuspecVersion Condition="$(BuildForDaily) == 'true'">$(MajorVersionNumber).$(MinorVersionNumber).$(DailyBuildVersion)</NuspecVersion>
20        <SignOutput>false</SignOutput>
21        <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
22        <TargetExt>.nupkg</TargetExt>
23        <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)\</IntermediateOutputPath>
24
25        <CleanCommand>rmdir /q/s "$(IntermediateOutputPath.TrimEnd(`\`))"</CleanCommand>
26
27        <PythonArguments>"$(PythonExe)" "$(PySourcePath)PC\layout"</PythonArguments>
28        <PythonArguments>$(PythonArguments) -b "$(BuildPath.TrimEnd(`\`))" -s "$(PySourcePath.TrimEnd(`\`))"</PythonArguments>
29        <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)obj"</PythonArguments>
30        <PythonArguments>$(PythonArguments) --copy "$(IntermediateOutputPath)pkg"</PythonArguments>
31        <PythonArguments>$(PythonArguments) --include-dev --include-tools --include-pip --include-stable --include-launcher --include-props</PythonArguments>
32
33        <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)pkg\pip.exe" -B -m pip install -U $(Packages)</PackageArguments>
34
35        <NugetPackCommand>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec" -BasePath "$(IntermediateOutputPath)pkg"</NugetPackCommand>
36        <NugetPackSymbolsCommand Condition="Exists('$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec')">"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec" -BasePath "$(BuildPath.TrimEnd(`\`))"</NugetPackSymbolsCommand>
37        <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
38        <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
39        <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
40
41        <Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
42        <Environment>$(Environment)%0D%0Aset PYTHON_NUSPEC_VERSION=$(NuspecVersion)</Environment>
43        <Environment Condition="$(Platform) != 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=$(Platform)</Environment>
44        <Environment Condition="$(Platform) == 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=Win32</Environment>
45        <Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" &gt;nul 2&gt;nul</Environment>
46    </PropertyGroup>
47
48    <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
49        <Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
50    </Target>
51
52    <Target Name="_Build">
53        <Exec Command="$(CleanCommand)" />
54        <Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)%0D%0A$(PackageArguments)" />
55
56        <Exec Command="$(NugetPackCommand) $(NugetArguments)" />
57        <Exec Command="$(NugetPackSymbolsCommand) $(NugetArguments)" Condition="$(NugetPackSymbolsCommand) != ''" />
58    </Target>
59
60    <Target Name="AfterBuild" />
61    <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
62</Project>
63