blob: 3750d8dcc860e862c93595b9dd031c4ec270dcd8 [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 Dower33f73102016-06-24 10:32:15 -070023 <IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)</IntermediateOutputPath>
24
25 <CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
26
27 <PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
Steve Dowerf0851912017-07-26 09:09:01 -070028 <PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(BuildPath.TrimEnd(`\`))"</PythonArguments>
Steve Dower33f73102016-06-24 10:32:15 -070029
Steve Dowere7614dd2016-06-25 16:13:30 -070030 <PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
Steve Dower33128c82016-06-27 09:34:18 -070031 <PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>
Steve Dower3f9fbfc2016-06-24 11:37:50 -070032
Steve Dower33f73102016-06-24 10:32:15 -070033 <NugetArguments>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec"</NugetArguments>
34 <NugetArguments>$(NugetArguments) -BasePath "$(IntermediateOutputPath)"</NugetArguments>
Steve Dower33128c82016-06-27 09:34:18 -070035 <NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
Steve Dower33f73102016-06-24 10:32:15 -070036 <NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
37 <NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
38
Steve Dower32861232017-03-16 10:19:18 -070039 <Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
Steve Dowerf0851912017-07-26 09:09:01 -070040 <Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
Steve Dower32861232017-03-16 10:19:18 -070041 <Environment Condition="Exists($(CRTRedist))">$(Environment)%0D%0Aset VCREDIST_PATH=$(CRTRedist)\$(Platform)</Environment>
Steve Dowerf0851912017-07-26 09:09:01 -070042 <Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" &gt;nul 2&gt;nul</Environment>
Steve Dower33f73102016-06-24 10:32:15 -070043 </PropertyGroup>
44
45 <Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
46 <Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
47 </Target>
48
49 <Target Name="_Build">
Steve Dower3f9fbfc2016-06-24 11:37:50 -070050 <Exec Command="$(CleanCommand)" />
Steve Dower32861232017-03-16 10:19:18 -070051 <Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)" />
Steve Dower3f9fbfc2016-06-24 11:37:50 -070052 <Exec Command="$(PipArguments)" />
Steve Dower33128c82016-06-27 09:34:18 -070053 <Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" />
Steve Dower33f73102016-06-24 10:32:15 -070054 <Exec Command="$(NugetArguments)" />
55 </Target>
56
57 <Target Name="AfterBuild" />
58 <Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
59</Project>