Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ReleaseUri"> |
| 3 | <PropertyGroup> |
Steve Dower | e4969f5 | 2015-02-28 19:53:50 -0800 | [diff] [blame^] | 4 | <TargetName>$(OutputName)</TargetName> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 5 | <DefineSolutionProperties>false</DefineSolutionProperties> |
| 6 | <TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
| 7 | <SuppressIces>$(SuppressIces);ICE03;ICE57;ICE61</SuppressIces> |
| 8 | <CompilerSuppressSpecificWarnings>1026</CompilerSuppressSpecificWarnings> |
| 9 | <BuildForRelease Condition="'$(BuildForRelease)' == ''">false</BuildForRelease> |
| 10 | <SignOutput Condition="'$(SigningCertificate)' != ''">true</SignOutput> |
| 11 | <Configuration Condition="'$(Configuration)' == ''">Release</Configuration> |
| 12 | <Platform Condition="'$(Platform)' == ''">x86</Platform> |
| 13 | <InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope> |
| 14 | <!-- |
| 15 | This URI is used to generate the various GUIDs used by the installer. |
| 16 | Installers built with the same URI will upgrade each other or block |
| 17 | when attempting to downgrade. |
| 18 | |
| 19 | By default, this is the local computer name, which will produce |
| 20 | installers that do not interfere with other installers. Products |
| 21 | that intend to bundle Python should rebuild these modules with their |
| 22 | own URI to avoid conflicting with the official releases. |
| 23 | |
| 24 | The official releases are built with http://www.python.org/. |
| 25 | |
| 26 | This is not the same as the DownloadUrl property used in the bundle |
| 27 | projects. |
| 28 | --> |
| 29 | <ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)</ReleaseUri> |
| 30 | <ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri> |
| 31 | </PropertyGroup> |
| 32 | |
| 33 | <Import Project="wix.props" /> |
| 34 | <Import Project="..\..\PCBuild\tcltk.props" /> |
| 35 | |
| 36 | <ItemGroup> |
| 37 | <Compile Include="$(MSBuildThisFileDirectory)common.wxs" /> |
| 38 | <WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" /> |
| 39 | <WixExtension Include="WixUtilExtension"> |
| 40 | <HintPath>WixUtilExtension</HintPath> |
| 41 | <Name>WixUtilExtension</Name> |
| 42 | </WixExtension> |
| 43 | </ItemGroup> |
| 44 | |
| 45 | <PropertyGroup> |
| 46 | <IntermediateOutputPath>$(MSBuildThisFileDirectory)\obj\$(Configuration)_$(Platform)\$(OutputName)</IntermediateOutputPath> |
| 47 | <IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath> |
| 48 | <OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath> |
| 49 | <OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath> |
| 50 | <OutDir>$(OutputPath)</OutDir> |
| 51 | <ReuseCabinetCache>true</ReuseCabinetCache> |
Steve Dower | e4969f5 | 2015-02-28 19:53:50 -0800 | [diff] [blame^] | 52 | <CRTRedist Condition="">$([System.IO.Path]::GetFullPath(`$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT`))</CRTRedist> |
| 53 | <CRTRedist Condition="'$(CRTRedist)' != '' and !Exists($(CRTRedist))">$(MSBuildThisFileDirectory)\redist\$(Platform)</CRTRedist> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 54 | <CRTRedist Condition="'$(CRTRedist)' != '' and !Exists($(CRTRedist))"></CRTRedist> |
| 55 | |
| 56 | <RevisionNumber>$(ReleaseLevelNumber)</RevisionNumber> |
| 57 | <RevisionNumber Condition="!$(BuildForRelease)">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber> |
| 58 | </PropertyGroup> |
| 59 | |
| 60 | <PropertyGroup> |
| 61 | <Bitness>32-bit</Bitness> |
| 62 | <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness> |
| 63 | <DefineConstants> |
| 64 | $(DefineConstants); |
| 65 | Version=$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber); |
| 66 | ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber); |
| 67 | LongVersion=$(PythonVersion); |
| 68 | MajorVersionNumber=$(MajorVersionNumber); |
| 69 | MinorVersionNumber=$(MinorVersionNumber); |
| 70 | UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0; |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 71 | NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0; |
| 72 | PyDebugExt=$(PyDebugExt); |
| 73 | </DefineConstants> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 74 | <DefineConstants Condition="'$(CRTRedist)' != ''"> |
| 75 | $(DefineConstants);CRTRedist=$(CRTRedist); |
| 76 | </DefineConstants> |
| 77 | <DefineConstants Condition="$(Configuration) != 'Debug'"> |
| 78 | $(DefineConstants);TestPrefix=;FileExtension=py; |
| 79 | </DefineConstants> |
| 80 | <DefineConstants Condition="$(Configuration) == 'Debug'"> |
| 81 | $(DefineConstants);TestPrefix=x;FileExtension=px; |
| 82 | </DefineConstants> |
| 83 | <DefineConstants Condition="$(Platform) != 'x64'"> |
| 84 | $(DefineConstants);Suffix32=-32; |
| 85 | </DefineConstants> |
| 86 | <DefineConstants Condition="$(Platform) == 'x64'"> |
| 87 | $(DefineConstants);Suffix32=; |
| 88 | </DefineConstants> |
| 89 | </PropertyGroup> |
| 90 | |
| 91 | <ItemDefinitionGroup> |
| 92 | <InstallFiles> |
| 93 | <Group>generated_filelist</Group> |
| 94 | <Condition></Condition> |
| 95 | <DiskId></DiskId> |
| 96 | </InstallFiles> |
| 97 | <LinkerBindInputPaths> |
| 98 | <Visible>false</Visible> |
| 99 | </LinkerBindInputPaths> |
| 100 | </ItemDefinitionGroup> |
| 101 | <ItemGroup> |
| 102 | <LinkerBindInputPaths Include="$(BuildPath);$(PySourcePath)Doc\build\htmlhelp"> |
| 103 | <BindName></BindName> |
| 104 | </LinkerBindInputPaths> |
| 105 | <LinkerBindInputPaths Include="$(PySourcePath)"> |
| 106 | <BindName>src</BindName> |
| 107 | </LinkerBindInputPaths> |
| 108 | <LinkerBindInputPaths Include="$(tcltkDir)"> |
| 109 | <BindName>tcltk</BindName> |
| 110 | </LinkerBindInputPaths> |
| 111 | <LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''"> |
| 112 | <BindName>crt</BindName> |
| 113 | </LinkerBindInputPaths> |
Steve Dower | e4969f5 | 2015-02-28 19:53:50 -0800 | [diff] [blame^] | 114 | <LinkerBindInputPaths Include="$(MSBuildThisFileDirectory)\redist"> |
| 115 | <BindName>redist</BindName> |
| 116 | </LinkerBindInputPaths> |
Steve Dower | bb24087 | 2015-02-05 22:08:48 -0800 | [diff] [blame] | 117 | </ItemGroup> |
| 118 | |
| 119 | <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild"> |
| 120 | <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" /> |
| 121 | </Target> |
| 122 | |
| 123 | <ItemGroup> |
| 124 | <_Uuid Include="CoreUpgradeCode"> |
| 125 | <Uri>upgradecode</Uri> |
| 126 | </_Uuid> |
| 127 | <_Uuid Include="UpgradeCode"> |
| 128 | <Uri>upgradecode/$(OutputName)</Uri> |
| 129 | </_Uuid> |
| 130 | <_Uuid Include="InstallDirectoryGuidSeed"> |
| 131 | <Uri>installdirectoryseed</Uri> |
| 132 | </_Uuid> |
| 133 | <_Uuid Include="PythonExeComponentGuid"> |
| 134 | <Uri>python.exe</Uri> |
| 135 | </_Uuid> |
| 136 | <_Uuid Include="PythonwExeComponentGuid"> |
| 137 | <Uri>pythonw.exe</Uri> |
| 138 | </_Uuid> |
| 139 | <_Uuid Include="RemoveLib2to3PickleComponentGuid"> |
| 140 | <Uri>lib2to3/pickles</Uri> |
| 141 | </_Uuid> |
| 142 | </ItemGroup> |
| 143 | <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild"> |
| 144 | <PropertyGroup> |
| 145 | <_Uuids>@(_Uuid->'("%(Identity)", "%(Uri)")',',')</_Uuids> |
| 146 | <_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri)' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))]))</_GenerateCommand> |
| 147 | </PropertyGroup> |
| 148 | |
| 149 | <Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"' IgnoreExitCode="false" /> |
| 150 | |
| 151 | <ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt"> |
| 152 | <Output TaskParameter="Lines" ItemName="_UuidValue" /> |
| 153 | </ReadLinesFromFile> |
| 154 | |
| 155 | <PropertyGroup> |
| 156 | <DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants> |
| 157 | </PropertyGroup> |
| 158 | </Target> |
| 159 | </Project> |