blob: 710ef3dcb5c01de169dafda3f66f8359803a77a0 [file] [log] [blame]
Steve Dower33f73102016-06-24 10:32:15 -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>{10487945-15D1-4092-A214-338395C4116B}</ProjectGuid>
5 <OutputName>python</OutputName>
6 <OutputName Condition="$(Platform) == 'x86'">$(OutputName)x86</OutputName>
Paul Monsonaa25d5d2019-04-12 09:36:38 -07007 <OutputName Condition="$(Platform) == 'ARM'">$(OutputName)arm32</OutputName>
Steve Dowerf0851912017-07-26 09:09:01 -07008 <OutputName Condition="$(BuildForDaily) == 'true'">$(OutputName)daily</OutputName>
Steve Dower33f73102016-06-24 10:32:15 -07009 <OutputSuffix></OutputSuffix>
10 <SupportSigning>false</SupportSigning>
Steve Dowere7614dd2016-06-25 16:13:30 -070011 <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
Steve Dower33f73102016-06-24 10:32:15 -070012 </PropertyGroup>
13
14 <Import Project="..\msi\msi.props" />
15
16 <PropertyGroup>
17 <Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
18 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
Steve Dower41fca9d2016-09-12 13:29:58 -070019 <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
Steve Dowerf0851912017-07-26 09:09:01 -070020 <NuspecVersion Condition="$(BuildForDaily) == 'true'">$(MajorVersionNumber).$(MinorVersionNumber).$(DailyBuildVersion)</NuspecVersion>
Steve Dower33f73102016-06-24 10:32:15 -070021 <SignOutput>false</SignOutput>
22 <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
23 <TargetExt>.nupkg</TargetExt>
Steve Dower0cd63912018-12-10 18:52:57 -080024 <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)\</IntermediateOutputPath>
Steve Dower33f73102016-06-24 10:32:15 -070025
Steve Dower0cd63912018-12-10 18:52:57 -080026 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath.TrimEnd(`\`))"</CleanCommand>
Steve Dower33f73102016-06-24 10:32:15 -070027
Steve Dower0cd63912018-12-10 18:52:57 -080028 <PythonArguments>"$(PythonExe)" "$(PySourcePath)PC\layout"</PythonArguments>
29 <PythonArguments>$(PythonArguments) -b "$(BuildPath.TrimEnd(`\`))" -s "$(PySourcePath.TrimEnd(`\`))"</PythonArguments>
30 <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)obj"</PythonArguments>
31 <PythonArguments>$(PythonArguments) --copy "$(IntermediateOutputPath)pkg"</PythonArguments>
Paul Mooree7241522019-03-30 16:32:05 +000032 <PythonArguments>$(PythonArguments) --preset-nuget</PythonArguments>
Steve Dower33f73102016-06-24 10:32:15 -070033
Steve Dower0cd63912018-12-10 18:52:57 -080034 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)pkg\pip.exe" -B -m pip install -U $(Packages)</PackageArguments>
Steve Dower3f9fbfc2016-06-24 11:37:50 -070035
Steve Dower03153dd2020-02-29 00:21:46 +000036 <NugetPackCommand>"$(Nuget)" pack "$(IntermediateOutputPath)pkg\python.nuspec" -BasePath "$(IntermediateOutputPath)pkg"</NugetPackCommand>
Steve Dowerf1ff2c42017-08-17 10:24:18 -070037 <NugetPackSymbolsCommand Condition="Exists('$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec')">"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec" -BasePath "$(BuildPath.TrimEnd(`\`))"</NugetPackSymbolsCommand>
Steve Dower33128c82016-06-27 09:34:18 -070038 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
Steve Dower33f73102016-06-24 10:32:15 -070039 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
40 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
41
Steve Dowerf0851912017-07-26 09:09:01 -070042 <Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
Steve Dower0cd63912018-12-10 18:52:57 -080043 <Environment>$(Environment)%0D%0Aset PYTHON_NUSPEC_VERSION=$(NuspecVersion)</Environment>
44 <Environment Condition="$(Platform) != 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=$(Platform)</Environment>
45 <Environment Condition="$(Platform) == 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=Win32</Environment>
Steve Dowerf0851912017-07-26 09:09:01 -070046 <Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" &gt;nul 2&gt;nul</Environment>
Steve Dower33f73102016-06-24 10:32:15 -070047 </PropertyGroup>
48
49 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
50 <Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
51 </Target>
52
53 <Target Name="_Build">
Steve Dower3f9fbfc2016-06-24 11:37:50 -070054 <Exec Command="$(CleanCommand)" />
Steve Dower0cd63912018-12-10 18:52:57 -080055 <Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)%0D%0A$(PackageArguments)" />
Steve Dower1f06a682017-09-06 19:29:10 -070056
Steve Dowerf1ff2c42017-08-17 10:24:18 -070057 <Exec Command="$(NugetPackCommand) $(NugetArguments)" />
58 <Exec Command="$(NugetPackSymbolsCommand) $(NugetArguments)" Condition="$(NugetPackSymbolsCommand) != ''" />
Steve Dower33f73102016-06-24 10:32:15 -070059 </Target>
60
61 <Target Name="AfterBuild" />
62 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
63</Project>