Skip to content

Commit 886f6b1

Browse files
committed
WiX: add packaging rules for swift-format
Add the package manifest and the msbuild support to package a MSI for swift-format.
1 parent fc8beee commit 886f6b1

File tree

3 files changed

+188
-0
lines changed

3 files changed

+188
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<Product Id="*" Language="1033" Manufacturer="swift.org" Name="Swift Code Formatter for Windows x86_64" UpgradeCode="2f8df238-f65c-4bf4-a78e-f2d26ee27225" Version="$(var.ProductVersion)">
4+
<Package Comments="Copyright (c) 2021-2022 Swift Open Source Project" Compressed="yes" Description="Swift Code Formatter for Windows x86_64" InstallScope="perMachine" Manufacturer="swift.org" />
5+
6+
<!-- NOTE(compnerd) use pre-3.0 schema for better compatibility. -->
7+
<Media Id="1" Cabinet="SwiftFormat.cab" EmbedCab="yes" />
8+
<?ifdef INCLUDE_DEBUG_INFO?>
9+
<Media Id="2" Cabinet="PDBs.cab" EmbedCab="yes" />
10+
<?endif?>
11+
12+
<!-- Directory Structure -->
13+
<Directory Id="TARGETDIR" Name="SourceDir">
14+
<Directory Id="INSTALLDIR">
15+
<Directory Id="Developer" Name="Developer">
16+
<Directory Id="Tools" Name="Tools">
17+
</Directory>
18+
</Directory>
19+
</Directory>
20+
</Directory>
21+
22+
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library">
23+
NOT INSTALLDIR
24+
</SetDirectory>
25+
26+
<!-- Components -->
27+
<ComponentGroup Id="SwiftFormat">
28+
<Component Id="swift_format.exe" Directory="Tools" Guid="ad2f571d-141f-4d44-a917-59adafbdaa5a">
29+
<File Id="swift_format.exe" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.exe" Checksum="yes" />
30+
</Component>
31+
</ComponentGroup>
32+
33+
<?ifdef INCLUDE_DEBUG_INFO ?>
34+
<ComponentGroup Id="SwiftFormatDebugInfo">
35+
<Component Id="swift_format.pdb" Directory="Tools" Guid="c0cd09c3-09be-48af-8321-63fee64cc2c3">
36+
<File Id="swift_format.pdb" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.pdb" Checksum="yes" />
37+
</Component>
38+
</ComponentGroup>
39+
<?endif?>
40+
41+
<DirectoryRef Id="TARGETDIR">
42+
<Component Id="EnvironmentVariables" Guid="645cdd3d-9dde-4e6d-8071-c0349ae87bcf">
43+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Developer\Tools" />
44+
</Component>
45+
</DirectoryRef>
46+
47+
<Feature Id="SwiftFormat" Absent="disallow" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Code Formatter for Windows x86_64" Level="1" Title="Swift Code Formatter (Windows x86_64)">
48+
<ComponentGroupRef Id="SwiftFormat" />
49+
<ComponentRef Id="EnvironmentVariables" />
50+
51+
<?ifdef INCLUDE_DEBUG_INFO?>
52+
<Feature Id="DebugInfo" Absent="allow" Description="Debug Information for Swift Code Formatter for Windows x86_64" Level="0" Title="Debug Information">
53+
<Condition Level="1">INSTALL_DEBUGINFO</Condition>
54+
<ComponentGroupRef Id="SwiftFormatDebugInfo" />
55+
</Feature>
56+
<?endif?>
57+
</Feature>
58+
59+
<UI>
60+
<UIRef Id="WixUI_InstallDir" />
61+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
62+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
63+
</UI>
64+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" ></Property>
65+
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
66+
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
67+
68+
</Product>
69+
</Wix>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3+
<Product Id="*" Language="1033" Manufacturer="swift.org" Name="Swift Code Formatter for Windows aarch64" UpgradeCode="45f1ae7a-4d90-414d-80b3-a5a45898b212" Version="$(var.ProductVersion)">
4+
<Package Comments="Copyright (c) 2021-2022 Swift Open Source Project" Compressed="yes" Description="Swift Code Formatter for Windows aarch64" InstallScope="perMachine" Manufacturer="swift.org" />
5+
6+
<!-- NOTE(compnerd) use pre-3.0 schema for better compatibility. -->
7+
<Media Id="1" Cabinet="SwiftFormat.cab" EmbedCab="yes" />
8+
<?ifdef INCLUDE_DEBUG_INFO?>
9+
<Media Id="2" Cabinet="PDBs.cab" EmbedCab="yes" />
10+
<?endif?>
11+
12+
<!-- Directory Structure -->
13+
<Directory Id="TARGETDIR" Name="SourceDir">
14+
<Directory Id="INSTALLDIR">
15+
<Directory Id="Developer" Name="Developer">
16+
<Directory Id="Tools" Name="Tools">
17+
</Directory>
18+
</Directory>
19+
</Directory>
20+
</Directory>
21+
22+
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library">
23+
NOT INSTALLDIR
24+
</SetDirectory>
25+
26+
<!-- Components -->
27+
<ComponentGroup Id="SwiftFormat">
28+
<Component Id="swift_format.exe" Directory="Tools" Guid="1e6c84e1-6cf4-4e34-90f6-eb76c278f7e2">
29+
<File Id="swift_format.exe" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.exe" Checksum="yes" />
30+
</Component>
31+
</ComponentGroup>
32+
33+
<?ifdef INCLUDE_DEBUG_INFO ?>
34+
<ComponentGroup Id="SwiftFormatDebugInfo">
35+
<Component Id="swift_format.pdb" Directory="Tools" Guid="24079895-af2f-4a67-95f3-a262d4e88390">
36+
<File Id="swift_format.pdb" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.pdb" Checksum="yes" />
37+
</Component>
38+
</ComponentGroup>
39+
<?endif?>
40+
41+
<DirectoryRef Id="TARGETDIR">
42+
<Component Id="EnvironmentVariables" Guid="c1a01e55-3353-4eca-8b58-9960e57a3758">
43+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Developer\Tools" />
44+
</Component>
45+
</DirectoryRef>
46+
47+
<Feature Id="SwiftFormat" Absent="disallow" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Code Formatter for Windows aarch64" Level="1" Title="Swift Code Formatter (Windows aarch64)">
48+
<ComponentGroupRef Id="SwiftFormat" />
49+
<ComponentRef Id="EnvironmentVariables" />
50+
51+
<?ifdef INCLUDE_DEBUG_INFO?>
52+
<Feature Id="DebugInfo" Absent="allow" Description="Debug Information for Swift Code Formatter for Windows aarch64" Level="0" Title="Debug Information">
53+
<Condition Level="1">INSTALL_DEBUGINFO</Condition>
54+
<ComponentGroupRef Id="SwiftFormatDebugInfo" />
55+
</Feature>
56+
<?endif?>
57+
</Feature>
58+
59+
<UI>
60+
<UIRef Id="WixUI_InstallDir" />
61+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
62+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
63+
</UI>
64+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" ></Property>
65+
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
66+
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
67+
68+
</Product>
69+
</Wix>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTarget="build">
3+
<PropertyGroup>
4+
<OutputName>swift-format</OutputName>
5+
<OutputType>Package</OutputType>
6+
<ProjectGuid>19d8e67a-655f-4ac2-a868-2ce653506192</ProjectGuid>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
11+
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
12+
<ProductArchitecture>$(ProductArchitecture)</ProductArchitecture>
13+
14+
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
15+
<ProductVersion>$(ProductVersion)</ProductVersion>
16+
</PropertyGroup>
17+
18+
<PropertyGroup>
19+
<OutputPath>build\</OutputPath>
20+
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
21+
<DefineSolutionProperties>false</DefineSolutionProperties>
22+
</PropertyGroup>
23+
24+
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
25+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
26+
<Target Name="EnsureWiXToolsetInstalled" Condition="">
27+
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see https://wixtoolset.org/releases/." />
28+
</Target>
29+
30+
<PropertyGroup>
31+
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
32+
</PropertyGroup>
33+
34+
<Import Project="WiXCodeSigning.targets" />
35+
36+
<PropertyGroup>
37+
<DefineConstants>ProductVersion=$(ProductVersion);SWIFT_FORMAT_BUILD=$(SWIFT_FORMAT_BUILD)</DefineConstants>
38+
</PropertyGroup>
39+
40+
<ItemGroup>
41+
<WixExtension Include="WixUIExtension">
42+
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
43+
<Name>WixUIExtension</Name>
44+
</WixExtension>
45+
</ItemGroup>
46+
47+
<ItemGroup>
48+
<Compile Include="swift-format-$(ProductArchitecture).wxs" />
49+
</ItemGroup>
50+
</Project>

0 commit comments

Comments
 (0)