Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 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> |
Steve Dower | 2b8f094 | 2016-06-27 09:54:03 -0700 | [diff] [blame] | 10 | <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease> |
Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 11 | </PropertyGroup> |
| 12 | |
| 13 | <Import Project="..\..\PCBuild\python.props" /> |
| 14 | |
| 15 | <PropertyGroup> |
| 16 | <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion> |
Steve Dower | 0b69b37 | 2017-08-26 18:00:48 -0700 | [diff] [blame] | 17 | <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion> |
Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 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> |
Steve Dower | 2b8f094 | 2016-06-27 09:54:03 -0700 | [diff] [blame] | 31 | <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments> |
Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 32 | |
| 33 | <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments> |
| 34 | <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments> |
Steve Dower | 2b8f094 | 2016-06-27 09:54:03 -0700 | [diff] [blame] | 35 | <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments> |
Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 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)" /> |
Steve Dower | 2b8f094 | 2016-06-27 09:54:03 -0700 | [diff] [blame] | 48 | <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" /> |
Steve Dower | 4da5815 | 2016-06-24 11:39:57 -0700 | [diff] [blame] | 49 | <Exec Command="$(NugetArguments)" /> |
| 50 | </Target> |
| 51 | |
| 52 | <Target Name="AfterBuild" /> |
| 53 | <Target Name="Build" DependsOnTargets="_Build;AfterBuild" /> |
| 54 | </Project> |