Skip to content

Commit 36b3647

Browse files
committed
Refactoring swiftlang#1
## Deduplication - Move common .wixproj content to Directory.Build.props and Directory.Build.targets. - Move common authoring to a shared .wixlib project. - Add localization file for common strings. - Use ComponentGroup/@Directory for default component directories. ## Simplification - Move CompressionLevel into Directory.Build.props. - Have Directory.Build.props import <user>.props (say, to override CompressionLevel for faster local builds). - Remove Id attributes from resources that aren't explicitly referenced. - Remove redundant/irrelevant attributes (e.g., File/@keypath). - Use `ProjectReference`s to manage build order and bind paths, including three flavors of SDK. - Remove MSI UI as the bundle UI replaces it.
1 parent e6e2632 commit 36b3647

25 files changed

+948
-1240
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<PropertyGroup>
4+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
5+
<EnableDefaultEmbeddedResourceItems>true</EnableDefaultEmbeddedResourceItems>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
10+
<ProductArchitecture>$(ProductArchitecture)</ProductArchitecture>
11+
12+
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
13+
<ProductVersion>$(ProductVersion)</ProductVersion>
14+
</PropertyGroup>
15+
16+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
17+
<Platform>x64</Platform>
18+
</PropertyGroup>
19+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
20+
<Platform>arm64</Platform>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm' ">
23+
<Platform>arm</Platform>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
26+
<Platform>x86</Platform>
27+
</PropertyGroup>
28+
29+
<PropertyGroup>
30+
<!--
31+
<OutputPath>build\$(ProductArchitecture)\</OutputPath>
32+
<IntermediateOutputPath>build\obj\$(ProductArchitecture)\</IntermediateOutputPath>
33+
-->
34+
<DefaultCompressionLevel Condition="'$(DefaultCompressionLevel)' == ''">high</DefaultCompressionLevel>
35+
</PropertyGroup>
36+
37+
<PropertyGroup>
38+
<DefineConstants>
39+
$(DefineConstants);
40+
ProductArchitecture=$(ProductArchitecture);
41+
ProductVersion=$(ProductVersion);
42+
</DefineConstants>
43+
</PropertyGroup>
44+
45+
<PropertyGroup>
46+
<HarvestNoLogo>true</HarvestNoLogo>
47+
<HarvestGenerateGuidsNow>true</HarvestGenerateGuidsNow>
48+
</PropertyGroup>
49+
50+
<Import Project="$(USERNAME).props" Condition="Exists('$(USERNAME).props')" />
51+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
<Import Project="WiXCodeSigning.targets" />
4+
</Project>

platforms/Windows/bld.wixproj

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,23 @@
1-
<Project Sdk="WixToolset.Sdk/4.0.0">
1+
<Project Sdk="WixToolset.Sdk/4.0.1">
22
<PropertyGroup>
3-
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
3+
<DefineConstants>
4+
$(DefineConstants);
5+
DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);
6+
TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);
7+
TOOLCHAIN_ROOT_USR_LIB_CLANG=$(TOOLCHAIN_ROOT_USR_LIB_CLANG);
8+
</DefineConstants>
49
</PropertyGroup>
510

6-
<PropertyGroup>
7-
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
8-
<ProductArchitecture>$(ProductArchitecture)</ProductArchitecture>
9-
10-
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
11-
<ProductVersion>$(ProductVersion)</ProductVersion>
12-
</PropertyGroup>
13-
14-
<PropertyGroup>
15-
<OutputPath>build\</OutputPath>
16-
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
17-
</PropertyGroup>
18-
19-
<Import Project="WiXCodeSigning.targets" />
20-
21-
<PropertyGroup>
22-
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);TOOLCHAIN_ROOT_USR_LIB_CLANG=$(TOOLCHAIN_ROOT)\usr\lib\clang</DefineConstants>
23-
</PropertyGroup>
24-
25-
<PropertyGroup>
26-
<HarvestNoLogo>true</HarvestNoLogo>
27-
<HarvestGenerateGuidsNow>true</HarvestGenerateGuidsNow>
28-
</PropertyGroup>
11+
<ItemGroup>
12+
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
13+
</ItemGroup>
2914

30-
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
31-
<InstallerPlatform>x64</InstallerPlatform>
32-
</PropertyGroup>
33-
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
34-
<InstallerPlatform>arm64</InstallerPlatform>
35-
<InstallerVersion>500</InstallerVersion>
36-
</PropertyGroup>
37-
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm' ">
38-
<InstallerPlatform>arm</InstallerPlatform>
39-
<InstallerVersion>500</InstallerVersion>
40-
</PropertyGroup>
41-
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
42-
<InstallerPlatform>x86</InstallerPlatform>
43-
</PropertyGroup>
15+
<ItemGroup>
16+
<ProjectReference Include="shared.wixproj" />
17+
</ItemGroup>
4418

4519
<ItemGroup>
46-
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0" />
47-
<PackageReference Include="WixToolset.Heat" Version="4.0.0" />
20+
<Compile Include="bld.wxs" />
4821
</ItemGroup>
4922

5023
<ItemGroup>
@@ -56,7 +29,5 @@
5629
<SuppressRegistry>true</SuppressRegistry>
5730
<SuppressRootDirectory>true</SuppressRootDirectory>
5831
</HarvestDirectory>
59-
60-
<Compile Include="bld.wxs" />
6132
</ItemGroup>
6233
</Project>

0 commit comments

Comments
 (0)