blob: 0f3f8bd000a04ed0abfeca0dd4e39410043860db [file] [log] [blame]
Steve Dower4da58152016-06-24 11:39:57 -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>{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 Dower2b8f0942016-06-27 09:54:03 -070010 <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
Steve Dower4da58152016-06-24 11:39:57 -070011 </PropertyGroup>
12
13 <Import Project="..\..\PCBuild\python.props" />
14
15 <PropertyGroup>
16 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
Steve Dower0b69b372017-08-26 18:00:48 -070017 <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
Steve Dower4da58152016-06-24 11:39:57 -070018 <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 Dower2b8f0942016-06-27 09:54:03 -070031 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>
Steve Dower4da58152016-06-24 11:39:57 -070032
33 <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments>
34 <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments>
Steve Dower2b8f0942016-06-27 09:54:03 -070035 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
Steve Dower4da58152016-06-24 11:39:57 -070036 <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 Dower2b8f0942016-06-27 09:54:03 -070048 <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" />
Steve Dower4da58152016-06-24 11:39:57 -070049 <Exec Command="$(NugetArguments)" />
50 </Target>
51
52 <Target Name="AfterBuild" />
53 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
54</Project>