blob: 26d900e5b4cea0f11d1f2cd2fcf52fa3a0d3f4c2 [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>
10 </PropertyGroup>
11
12 <Import Project="..\..\PCBuild\python.props" />
13
14 <PropertyGroup>
15 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
16 <SignOutput>false</SignOutput>
17 <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
18 <TargetExt>.nupkg</TargetExt>
19 <TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath>
20 <IntermediateOutputPath>$(MSBuildThisFileDirectory)\obj_$(ArchName)</IntermediateOutputPath>
21
22 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
23
24 <Python Condition="$(Python) == ''">py</Python>
25 <PythonArguments>"$(Python)" "$(MSBuildThisFileDirectory)\make_zip.py"</PythonArguments>
26 <PythonArguments>$(PythonArguments) -s "$(PySourcePath.Trim('\'))" -t "$(IntermediateOutputPath)" -a $(ArchName)</PythonArguments>
27
28 <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
29
30 <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments>
31 <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments>
32 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim('\'))"</NugetArguments>
33 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
34 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
35 </PropertyGroup>
36
37 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
38 <Error Text="$$(Nuget) could not be found. Specify a valid path on the command line." />
39 </Target>
40
41 <Target Name="_Build">
42 <Exec Command="$(CleanCommand)" />
43 <Exec Command="$(PythonArguments)" />
44 <Exec Command="$(PipArguments)" />
45 <Exec Command="$(NugetArguments)" />
46 </Target>
47
48 <Target Name="AfterBuild" />
49 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
50</Project>