blob: e093a6d0bd76b0ff2901a18cf683f5ac331eefb4 [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>
Steve Dowerf0851912017-07-26 09:09:01 -07007 <OutputName Condition="$(BuildForDaily) == 'true'">$(OutputName)daily</OutputName>
Steve Dower33f73102016-06-24 10:32:15 -07008 <OutputSuffix></OutputSuffix>
9 <SupportSigning>false</SupportSigning>
Steve Dowere7614dd2016-06-25 16:13:30 -070010 <BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
Steve Dower33f73102016-06-24 10:32:15 -070011 </PropertyGroup>
12
13 <Import Project="..\msi\msi.props" />
14
15 <PropertyGroup>
16 <Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
17 <NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
Steve Dower41fca9d2016-09-12 13:29:58 -070018 <NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
Steve Dowerf0851912017-07-26 09:09:01 -070019 <NuspecVersion Condition="$(BuildForDaily) == 'true'">$(MajorVersionNumber).$(MinorVersionNumber).$(DailyBuildVersion)</NuspecVersion>
Steve Dower33f73102016-06-24 10:32:15 -070020 <SignOutput>false</SignOutput>
21 <TargetName>$(OutputName).$(NuspecVersion)</TargetName>
22 <TargetExt>.nupkg</TargetExt>
Steve Dower0cd63912018-12-10 18:52:57 -080023 <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)\</IntermediateOutputPath>
Steve Dower33f73102016-06-24 10:32:15 -070024
Steve Dower0cd63912018-12-10 18:52:57 -080025 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath.TrimEnd(`\`))"</CleanCommand>
Steve Dower33f73102016-06-24 10:32:15 -070026
Steve Dower0cd63912018-12-10 18:52:57 -080027 <PythonArguments>"$(PythonExe)" "$(PySourcePath)PC\layout"</PythonArguments>
28 <PythonArguments>$(PythonArguments) -b "$(BuildPath.TrimEnd(`\`))" -s "$(PySourcePath.TrimEnd(`\`))"</PythonArguments>
29 <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)obj"</PythonArguments>
30 <PythonArguments>$(PythonArguments) --copy "$(IntermediateOutputPath)pkg"</PythonArguments>
31 <PythonArguments>$(PythonArguments) --include-dev --include-tools --include-pip --include-stable --include-launcher --include-props</PythonArguments>
Steve Dower33f73102016-06-24 10:32:15 -070032
Steve Dower0cd63912018-12-10 18:52:57 -080033 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)pkg\pip.exe" -B -m pip install -U $(Packages)</PackageArguments>
Steve Dower3f9fbfc2016-06-24 11:37:50 -070034
Steve Dower0cd63912018-12-10 18:52:57 -080035 <NugetPackCommand>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec" -BasePath "$(IntermediateOutputPath)pkg"</NugetPackCommand>
Steve Dowerf1ff2c42017-08-17 10:24:18 -070036 <NugetPackSymbolsCommand Condition="Exists('$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec')">"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec" -BasePath "$(BuildPath.TrimEnd(`\`))"</NugetPackSymbolsCommand>
Steve Dower33128c82016-06-27 09:34:18 -070037 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
Steve Dower33f73102016-06-24 10:32:15 -070038 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
39 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
40
Steve Dowerf0851912017-07-26 09:09:01 -070041 <Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
Steve Dower0cd63912018-12-10 18:52:57 -080042 <Environment>$(Environment)%0D%0Aset PYTHON_NUSPEC_VERSION=$(NuspecVersion)</Environment>
43 <Environment Condition="$(Platform) != 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=$(Platform)</Environment>
44 <Environment Condition="$(Platform) == 'x86'">$(Environment)%0D%0Aset PYTHON_PROPS_PLATFORM=Win32</Environment>
Steve Dowerf0851912017-07-26 09:09:01 -070045 <Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" &gt;nul 2&gt;nul</Environment>
Steve Dower33f73102016-06-24 10:32:15 -070046 </PropertyGroup>
47
48 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
49 <Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
50 </Target>
51
52 <Target Name="_Build">
Steve Dower3f9fbfc2016-06-24 11:37:50 -070053 <Exec Command="$(CleanCommand)" />
Steve Dower0cd63912018-12-10 18:52:57 -080054 <Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)%0D%0A$(PackageArguments)" />
Steve Dower1f06a682017-09-06 19:29:10 -070055
Steve Dowerf1ff2c42017-08-17 10:24:18 -070056 <Exec Command="$(NugetPackCommand) $(NugetArguments)" />
57 <Exec Command="$(NugetPackSymbolsCommand) $(NugetArguments)" Condition="$(NugetPackSymbolsCommand) != ''" />
Steve Dower33f73102016-06-24 10:32:15 -070058 </Target>
59
60 <Target Name="AfterBuild" />
61 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
62</Project>