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>{6BA7092C-0093-47F0-9ED2-282AEE981E14}</ProjectGuid> 5 <OutputName>python2</OutputName> 6 <OutputName Condition="$(Platform) == 'x86' or $(Platform) == 'Win32' or $(Platform) == ''">$(OutputName)x86</OutputName> 7 <OutputPath Condition="$(OutputPath) == ''">$(MSBuildThisFileDirectory)</OutputPath> 8 <OutputSuffix></OutputSuffix> 9 <SupportSigning>false</SupportSigning> 10 <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease> 11 </PropertyGroup> 12 13 <Import Project="..\..\PCBuild\python.props" /> 14 15 <PropertyGroup> 16 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion> 17 <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion> 18 <SignOutput>false</SignOutput> 19 <TargetName>$(OutputName).$(NuspecVersion)</TargetName> 20 <TargetExt>.nupkg</TargetExt> 21 <TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath> 22 <IntermediateOutputPath>$(MSBuildThisFileDirectory)\obj_$(ArchName)</IntermediateOutputPath> 23 24 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand> 25 26 <Python Condition="$(Python) == ''">py</Python> 27 <PythonArguments>"$(Python)" "$(MSBuildThisFileDirectory)\make_zip.py"</PythonArguments> 28 <PythonArguments>$(PythonArguments) -s "$(PySourcePath.Trim('\'))" -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments> 29 30 <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments> 31 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments> 32 33 <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments> 34 <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments> 35 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments> 36 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments> 37 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments> 38 </PropertyGroup> 39 40 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))"> 41 <Error Text="$$(Nuget) could not be found. Specify a valid path on the command line." /> 42 </Target> 43 44 <Target Name="_Build"> 45 <Exec Command="$(CleanCommand)" /> 46 <Exec Command="$(PythonArguments)" /> 47 <Exec Command="$(PipArguments)" /> 48 <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" /> 49 <Exec Command="$(NugetArguments)" /> 50 </Target> 51 52 <Target Name="AfterBuild" /> 53 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" /> 54</Project> 55