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