2016-06-24 14:32:15 -03:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
|
|
<ProjectGuid>{10487945-15D1-4092-A214-338395C4116B}</ProjectGuid>
|
|
|
|
<OutputName>python</OutputName>
|
|
|
|
<OutputName Condition="$(Platform) == 'x86'">$(OutputName)x86</OutputName>
|
2017-07-26 13:09:01 -03:00
|
|
|
<OutputName Condition="$(BuildForDaily) == 'true'">$(OutputName)daily</OutputName>
|
2016-06-24 14:32:15 -03:00
|
|
|
<OutputSuffix></OutputSuffix>
|
|
|
|
<SupportSigning>false</SupportSigning>
|
2016-06-25 20:13:30 -03:00
|
|
|
<BuildForRelease Condition="$(BuildForRelease) == ''">true</BuildForRelease>
|
2016-06-24 14:32:15 -03:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Import Project="..\msi\msi.props" />
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<Nuget Condition="$(Nuget) == ''">$(ExternalsDir)\windows-installer\nuget\nuget.exe</Nuget>
|
|
|
|
<NuspecVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)</NuspecVersion>
|
2016-09-12 17:29:58 -03:00
|
|
|
<NuspecVersion Condition="$(ReleaseLevelName) != ''">$(NuspecVersion)-$(ReleaseLevelName)</NuspecVersion>
|
2017-07-26 13:09:01 -03:00
|
|
|
<NuspecVersion Condition="$(BuildForDaily) == 'true'">$(MajorVersionNumber).$(MinorVersionNumber).$(DailyBuildVersion)</NuspecVersion>
|
2016-06-24 14:32:15 -03:00
|
|
|
<SignOutput>false</SignOutput>
|
|
|
|
<TargetName>$(OutputName).$(NuspecVersion)</TargetName>
|
|
|
|
<TargetExt>.nupkg</TargetExt>
|
|
|
|
<IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)</IntermediateOutputPath>
|
|
|
|
|
|
|
|
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
|
|
|
|
|
|
|
|
<PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
|
2017-07-26 13:09:01 -03:00
|
|
|
<PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(BuildPath.TrimEnd(`\`))"</PythonArguments>
|
2016-06-24 14:32:15 -03:00
|
|
|
|
2016-06-25 20:13:30 -03:00
|
|
|
<PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
|
2016-06-27 13:34:18 -03:00
|
|
|
<PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>
|
2016-06-24 15:37:50 -03:00
|
|
|
|
2017-08-17 14:24:18 -03:00
|
|
|
<NugetPackCommand>"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).nuspec" -BasePath "$(IntermediateOutputPath)"</NugetPackCommand>
|
|
|
|
<NugetPackSymbolsCommand Condition="Exists('$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec')">"$(Nuget)" pack "$(MSBuildThisFileDirectory)\$(OutputName).symbols.nuspec" -BasePath "$(BuildPath.TrimEnd(`\`))"</NugetPackSymbolsCommand>
|
2016-06-27 13:34:18 -03:00
|
|
|
<NugetArguments>$(NugetArguments) -OutputDirectory "$(OutputPath.Trim(`\`))"</NugetArguments>
|
2016-06-24 14:32:15 -03:00
|
|
|
<NugetArguments>$(NugetArguments) -Version "$(NuspecVersion)"</NugetArguments>
|
|
|
|
<NugetArguments>$(NugetArguments) -NoPackageAnalysis -NonInteractive</NugetArguments>
|
|
|
|
|
2017-03-16 14:19:18 -03:00
|
|
|
<Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
|
2017-07-26 13:09:01 -03:00
|
|
|
<Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
|
2017-03-16 14:19:18 -03:00
|
|
|
<Environment Condition="Exists($(CRTRedist))">$(Environment)%0D%0Aset VCREDIST_PATH=$(CRTRedist)\$(Platform)</Environment>
|
2017-07-26 13:09:01 -03:00
|
|
|
<Environment>$(Environment)%0D%0Amkdir "$(OutputPath.Trim(`\`))" >nul 2>nul</Environment>
|
2016-06-24 14:32:15 -03:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="_NugetMissing" BeforeTargets="_Build" Condition="!Exists($(Nuget))">
|
|
|
|
<Error Text="$(Nuget) could not be found. Either avoid specifying the property or update your externals/windows-installer files." />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="_Build">
|
2016-06-24 15:37:50 -03:00
|
|
|
<Exec Command="$(CleanCommand)" />
|
2017-03-16 14:19:18 -03:00
|
|
|
<Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(PythonArguments)" />
|
2016-06-24 15:37:50 -03:00
|
|
|
<Exec Command="$(PipArguments)" />
|
2016-06-27 13:34:18 -03:00
|
|
|
<Exec Command="$(PackageArguments)" Condition="$(PackageArguments) != ''" />
|
2017-09-06 23:29:10 -03:00
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<_PropsContents>$([System.IO.File]::ReadAllText('python.props'))</_PropsContents>
|
|
|
|
<_PropsContents>$(_PropsContents.Replace('$$PYTHON_TAG$$', '$(MajorVersionNumber).$(MinorVersionNumber)'))</_PropsContents>
|
|
|
|
<_PropsContents>$(_PropsContents.Replace('$$PYTHON_VERSION$$', '$(NuspecVersion)'))</_PropsContents>
|
|
|
|
<_PropsContents Condition="$(Platform) == 'x86'">$(_PropsContents.Replace('$$PYTHON_PLATFORM$$', 'Win32'))</_PropsContents>
|
|
|
|
<_PropsContents Condition="$(Platform) != 'x86'">$(_PropsContents.Replace('$$PYTHON_PLATFORM$$', '$(Platform)'))</_PropsContents>
|
|
|
|
<_PropsContents>$(_PropsContents.Replace('$$PYTHON_TARGET$$', '_GetPythonRuntimeFilesDependsOn$(MajorVersionNumber)$(MinorVersionNumber)_$(Platform)'))</_PropsContents>
|
|
|
|
<_ExistingContents Condition="Exists('$(IntermediateOutputPath)\python.props')">$([System.IO.File]::ReadAllText('$(IntermediateOutputPath)\python.props'))</_ExistingContents>
|
|
|
|
</PropertyGroup>
|
|
|
|
<WriteLinesToFile File="$(IntermediateOutputPath)\python.props"
|
|
|
|
Lines="$(_PropsContents)"
|
|
|
|
Condition="$(_PropsContents) != $(_ExistingContents)" />
|
|
|
|
|
2017-08-17 14:24:18 -03:00
|
|
|
<Exec Command="$(NugetPackCommand) $(NugetArguments)" />
|
|
|
|
<Exec Command="$(NugetPackSymbolsCommand) $(NugetArguments)" Condition="$(NugetPackSymbolsCommand) != ''" />
|
2016-06-24 14:32:15 -03:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="AfterBuild" />
|
|
|
|
<Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
|
|
|
|
</Project>
|