Skip to content

Commit 9113f45

Browse files
authored
Merge pull request #346 from swiftlang/eng/android/6
[release/6] cherry-pick Android installer changes needed to build swift 6 installer
2 parents c6318d7 + 956295c commit 9113f45

File tree

12 files changed

+1357
-11
lines changed

12 files changed

+1357
-11
lines changed

platforms/Windows/SideBySideUpgradeStrategy.props

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
<DbgUpgradeCode>{91D382AF-1E92-44DC-A4AD-AEE91C1B5160}</DbgUpgradeCode>
2323
<IdeUpgradeCode>{8DD91C86-D13D-490B-B06B-9522A9CF504C}</IdeUpgradeCode>
2424
<RtlUpgradeCode>{BEA8C6DC-F73E-445B-9486-2333D1CF2886}</RtlUpgradeCode>
25-
<SdkUpgradeCode Condition=" '$(ProductArchitecture)' == 'x86' ">{443F4D7F-38F3-47C8-9BEE-37FEB01D13C8}</SdkUpgradeCode>
26-
<SdkUpgradeCode Condition=" '$(ProductArchitecture)' == 'amd64' ">{762D10FE-EBE5-4554-BB78-FB13A4A487E3}</SdkUpgradeCode>
27-
<SdkUpgradeCode Condition=" '$(ProductArchitecture)' == 'arm64' ">{9749D9E6-E860-4FF6-9E8A-525270F471A3}</SdkUpgradeCode>
25+
<WindowsSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'x86' ">{443F4D7F-38F3-47C8-9BEE-37FEB01D13C8}</WindowsSDKUpgradeCode>
26+
<WindowsSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'amd64' ">{762D10FE-EBE5-4554-BB78-FB13A4A487E3}</WindowsSDKUpgradeCode>
27+
<WindowsSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'arm64' ">{9749D9E6-E860-4FF6-9E8A-525270F471A3}</WindowsSDKUpgradeCode>
28+
<AndroidSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'aarch64' ">{485f88f4-9342-48cb-853a-12da885a5818}</AndroidSDKUpgradeCode>
29+
<AndroidSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'x86_64' ">{0838ee60-5d4a-4832-b844-73dad6eb1cc1}</AndroidSDKUpgradeCode>
30+
<AndroidSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'armv7' ">{1269a926-3528-4ab7-b4d6-386d5c3f903a}</AndroidSDKUpgradeCode>
31+
<AndroidSDKUpgradeCode Condition=" '$(ProductArchitecture)' == 'i686' ">{d889349b-0000-4600-a04a-93602525d5db}</AndroidSDKUpgradeCode>
2832
</PropertyGroup>
2933

3034
<PropertyGroup Condition="'$(MajorMinorProductVersion)' == '0.0'">
@@ -52,7 +56,8 @@
5256
DbgUpgradeCode=$(DbgUpgradeCode);
5357
IdeUpgradeCode=$(IdeUpgradeCode);
5458
RtlUpgradeCode=$(RtlUpgradeCode);
55-
SdkUpgradeCode=$(SdkUpgradeCode);
59+
WindowsSDKUpgradeCode=$(WindowsSDKUpgradeCode);
60+
AndroidSDKUpgradeCode=$(AndroidSDKUpgradeCode);
5661
</DefineConstants>
5762
</PropertyGroup>
5863
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<Project Sdk="WixToolset.Sdk/4.0.1">
2+
<PropertyGroup>
3+
<OutputName>android_sdk.$(ProductArchitecture)</OutputName>
4+
<Platform>x86</Platform>
5+
6+
<SwiftShimsPath>$(SDK_ROOT)\usr\lib\swift\shims</SwiftShimsPath>
7+
8+
<DefineConstants>
9+
$(DefineConstants);
10+
SwiftShimsPath=$(SwiftShimsPath);
11+
</DefineConstants>
12+
</PropertyGroup>
13+
14+
<ItemGroup>
15+
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<HarvestDirectory Include="$(SwiftShimsPath)">
20+
<ComponentGroupName>SwiftShims</ComponentGroupName>
21+
<DirectoryRefId>AndroidSDK_usr_lib_swift_shims</DirectoryRefId>
22+
<PreprocessorVariable>var.SwiftShimsPath</PreprocessorVariable>
23+
<SuppressCom>true</SuppressCom>
24+
<SuppressRegistry>true</SuppressRegistry>
25+
<SuppressRootDirectory>true</SuppressRootDirectory>
26+
</HarvestDirectory>
27+
</ItemGroup>
28+
</Project>

platforms/Windows/android_sdk/android_sdk.wxs

Lines changed: 1230 additions & 0 deletions
Large diffs are not rendered by default.

platforms/Windows/bld/bld.wixproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);
66
TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);
77
TOOLCHAIN_ROOT_USR_LIB_CLANG=$(TOOLCHAIN_ROOT)\usr\lib\clang;
8+
TOOLCHAIN_ROOT_USR_LIB_SWIFT_CLANG=$(TOOLCHAIN_ROOT)\usr\lib\swift\clang;
89
</DefineConstants>
910
</PropertyGroup>
1011

@@ -22,4 +23,15 @@
2223
<SuppressRootDirectory>true</SuppressRootDirectory>
2324
</HarvestDirectory>
2425
</ItemGroup>
26+
27+
<ItemGroup>
28+
<HarvestDirectory Include="$(TOOLCHAIN_ROOT)\usr\lib\swift\clang">
29+
<ComponentGroupName>SwiftClangResources</ComponentGroupName>
30+
<DirectoryRefId>_usr_lib_swift_clang</DirectoryRefId>
31+
<PreprocessorVariable>var.TOOLCHAIN_ROOT_USR_LIB_SWIFT_CLANG</PreprocessorVariable>
32+
<SuppressCom>true</SuppressCom>
33+
<SuppressRegistry>true</SuppressRegistry>
34+
<SuppressRootDirectory>true</SuppressRootDirectory>
35+
</HarvestDirectory>
36+
</ItemGroup>
2537
</Project>

platforms/Windows/bld/bld.wxs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@
441441
<ComponentGroupRef Id="TestingMacros" />
442442

443443
<ComponentGroupRef Id="ClangResources" />
444+
<ComponentGroupRef Id="SwiftClangResources" />
444445

445446
<ComponentGroupRef Id="EnvironmentVariables" />
446447
<ComponentGroupRef Id="VersionedDirectoryCleanup" />

platforms/Windows/bundle/installer.wixproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
$(DefineConstants);
99
INCLUDE_X86_SDK=$(INCLUDE_X86_SDK);
1010
INCLUDE_ARM64_SDK=$(INCLUDE_ARM64_SDK);
11+
ANDROID_INCLUDE_ARM64_SDK=$(ANDROID_INCLUDE_ARM64_SDK);
12+
ANDROID_INCLUDE_x86_64_SDK=$(ANDROID_INCLUDE_x86_64_SDK);
13+
ANDROID_INCLUDE_ARM_SDK=$(ANDROID_INCLUDE_ARM_SDK);
14+
ANDROID_INCLUDE_X86_SDK=$(ANDROID_INCLUDE_X86_SDK);
1115
</DefineConstants>
1216
</PropertyGroup>
1317

@@ -31,4 +35,20 @@
3135
<ItemGroup Condition=" '$(INCLUDE_ARM64_SDK)' != '' ">
3236
<ProjectReference Include="..\sdk\sdk.wixproj" Properties="ProductArchitecture=arm64;Platform=x86" BindName="sdk_arm64" />
3337
</ItemGroup>
38+
39+
<ItemGroup Condition=" '$(ANDROID_INCLUDE_ARM64_SDK)' != '' ">
40+
<ProjectReference Include="..\android_sdk\android_sdk.wixproj" Properties="ProductArchitecture=aarch64;Platform=x86" BindName="android_sdk_aarch64" />
41+
</ItemGroup>
42+
43+
<ItemGroup Condition=" '$(ANDROID_INCLUDE_x86_64_SDK)' != '' ">
44+
<ProjectReference Include="..\android_sdk\android_sdk.wixproj" Properties="ProductArchitecture=x86_64;Platform=x86" BindName="android_sdk_x86_64" />
45+
</ItemGroup>
46+
47+
<ItemGroup Condition=" '$(ANDROID_INCLUDE_ARM_SDK)' != '' ">
48+
<ProjectReference Include="..\android_sdk\android_sdk.wixproj" Properties="ProductArchitecture=armv7;Platform=x86" BindName="android_sdk_armv7" />
49+
</ItemGroup>
50+
51+
<ItemGroup Condition=" '$(ANDROID_INCLUDE_X86_SDK)' != '' ">
52+
<ProjectReference Include="..\android_sdk\android_sdk.wixproj" Properties="ProductArchitecture=i686;Platform=x86" BindName="android_sdk_i686" />
53+
</ItemGroup>
3454
</Project>

platforms/Windows/bundle/installer.wxs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
<Variable Name="OptionsInstallRedistAMD64" bal:Overridable="yes" Persisted="yes" Value="1" />
3939
<Variable Name="OptionsInstallSdkArm64" bal:Overridable="yes" Persisted="yes" Value="1" />
4040
<Variable Name="OptionsInstallRedistArm64" bal:Overridable="yes" Persisted="yes" Value="1" />
41+
<Variable Name="OptionsInstallAndroidSdkArm64" bal:Overridable="yes" Persisted="yes" Value="1" />
42+
<Variable Name="OptionsInstallAndroidSdkAMD64" bal:Overridable="yes" Persisted="yes" Value="1" />
43+
<Variable Name="OptionsInstallAndroidSdkArm" bal:Overridable="yes" Persisted="yes" Value="0" />
44+
<Variable Name="OptionsInstallAndroidSdkX86" bal:Overridable="yes" Persisted="yes" Value="0" />
4145

4246
<!--
4347
For the online bundle, we need to provide a download URL for each package and its .cabs.
@@ -119,6 +123,42 @@
119123
<MsiProperty Name="INSTALLREDIST" Value="[OptionsInstallRedistArm64]" />
120124
</MsiPackage>
121125
<?endif?>
126+
127+
<?if $(ANDROID_INCLUDE_ARM64_SDK) == true ?>
128+
<MsiPackage
129+
SourceFile="!(bindpath.android_sdk_aarch64)\android_sdk.aarch64.msi"
130+
InstallCondition="OptionsInstallAndroidSdkArm64"
131+
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
132+
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
133+
</MsiPackage>
134+
<?endif?>
135+
136+
<?if $(ANDROID_INCLUDE_x86_64_SDK) == true ?>
137+
<MsiPackage
138+
SourceFile="!(bindpath.android_sdk_x86_64)\android_sdk.x86_64.msi"
139+
InstallCondition="OptionsInstallAndroidSdkAMD64"
140+
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
141+
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
142+
</MsiPackage>
143+
<?endif?>
144+
145+
<?if $(ANDROID_INCLUDE_ARM_SDK) == true ?>
146+
<MsiPackage
147+
SourceFile="!(bindpath.android_sdk_armv7)\android_sdk.armv7.msi"
148+
InstallCondition="OptionsInstallAndroidSdkArm"
149+
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
150+
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
151+
</MsiPackage>
152+
<?endif?>
153+
154+
<?if $(ANDROID_INCLUDE_X86_SDK) == true ?>
155+
<MsiPackage
156+
SourceFile="!(bindpath.android_sdk_i686)\android_sdk.i686.msi"
157+
InstallCondition="OptionsInstallAndroidSdkX86"
158+
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
159+
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
160+
</MsiPackage>
161+
<?endif?>
122162
</Chain>
123163
</Bundle>
124164
</Wix>

platforms/Windows/bundle/theme.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<Font Id="2" Height="-22" Weight="500" Foreground="graytext">Segoe UI</Font>
1010
<Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>
1111

12-
<Window Width="614" Height="384" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
13-
<ImageControl X="0" Y="0" Width="165" Height="384" ImageFile="swift_side.png"/>
12+
<Window Width="614" Height="456" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
13+
<ImageControl X="0" Y="0" Width="165" Height="456" ImageFile="swift_side.png"/>
1414
<Label X="176" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>
1515

1616
<Page Name="Help">
@@ -67,6 +67,10 @@
6767
<Checkbox Name="OptionsInstallRedistArm64" X="194" Y="285" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallSdkArm64">#(loc.Redist_arm64)</Checkbox>
6868
<Checkbox Name="OptionsInstallSdkX86" X="176" Y="303" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Sdk_ProductName_x86)</Checkbox>
6969
<Checkbox Name="OptionsInstallRedistX86" X="194" Y="321" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallSdkX86">#(loc.Redist_x86)</Checkbox>
70+
<Checkbox Name="OptionsInstallAndroidSdkArm64" X="176" Y="339" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Android_Sdk_arm64)</Checkbox>
71+
<Checkbox Name="OptionsInstallAndroidSdkAMD64" X="176" Y="357" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Android_Sdk_amd64)</Checkbox>
72+
<Checkbox Name="OptionsInstallAndroidSdkArm" X="176" Y="375" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Android_Sdk_arm)</Checkbox>
73+
<Checkbox Name="OptionsInstallAndroidSdkX86" X="176" Y="393" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Android_Sdk_x86)</Checkbox>
7074

7175
<Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
7276
<Text>#(loc.OptionsOkButton)</Text>

platforms/Windows/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid
218218

219219
| Property | Description |
220220
| -------- | ----------- |
221-
| BldUpgradeCode, CliUpgradeCode, DbgUpgradeCode, IdeUpgradeCode, RtlUpgradeCode, SdkUpgradeCode | Upgrade codes for individual packages. Packages keep the same upgrade codes "forever" because MSI lets you specify version ranges for upgrades, which you can find in `shared/shared.wxs`. |
221+
| BldUpgradeCode, CliUpgradeCode, DbgUpgradeCode, IdeUpgradeCode, RtlUpgradeCode, WindowsSDKUpgradeCode, AndroidSDKUpgradeCode | Upgrade codes for individual packages. Packages keep the same upgrade codes "forever" because MSI lets you specify version ranges for upgrades, which you can find in `shared/shared.wxs`. |
222222
| BundleUpgradeCode | Upgrade codes for the bundle. Bundles don't support upgrade version ranges, so the bundle upgrade code must change for every minor version _and_ stay the same for the entire lifetime of that minor version (e.g., v5.10.0 through v5.10.9999). You can keep the history of upgrade codes using a condition like `Condition="'$(MajorMinorProductVersion)' == '5.10'` or just replace BundleUpgradeCode when forking to a new minor version. |
223223

224224

@@ -227,7 +227,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid
227227
To support side-by-side installation for each minor release (the latest point release of each minor release), we need to use "old-school" `Upgrade`/`UpgradeVersion` authoring to get the upgrade version ranges, which also requires manually scheduling `RemoveExistingProducts`. (We can no longer use WiX's `MajorUpgrade` element because it's intended to support the way-more-common case of upgrading every version.) To avoid duplication, the upgrade logic is authored in `shared\shared.wxs` and referenced from the `Package` element of each package:
228228

229229
```xml
230-
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(SdkUpgradeCode)" />
230+
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(WindowsSDKUpgradeCode)" />
231231
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />
232232
```
233233

platforms/Windows/sdk/sdk.wxs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
Language="1033"
2020
Manufacturer="!(loc.ManufacturerName)"
2121
Name="!(loc.Sdk_ProductName_$(ProductArchitecture))"
22-
UpgradeCode="$(SdkUpgradeCode)"
22+
UpgradeCode="$(WindowsSDKUpgradeCode)"
2323
Version="$(NonSemVerProductVersion)"
2424
Scope="$(PackageScope)">
2525

2626
<Media Id="1" Cabinet="sdk.$(ProductArchitecture).cab" EmbedCab="$(ArePackageCabsEmbedded)" />
2727

28-
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(SdkUpgradeCode)" />
28+
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(WindowsSDKUpgradeCode)" />
2929
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />
3030

3131
<!--

platforms/Windows/shared/shared.wxs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@
4444
<Directory Id="_usr_include" Name="include" />
4545
<Directory Id="_usr_lib" Name="lib">
4646
<Directory Id="_usr_lib_clang" Name="clang" />
47-
<Directory Id="_usr_lib_swift" Name="swift" />
47+
<Directory Id="_usr_lib_swift" Name="swift">
48+
<Directory Id="_usr_lib_swift_clang" Name="clang" />
49+
</Directory>
4850
</Directory>
4951
<Directory Id="_usr_share" Name="share">
5052
<Directory Id="_usr_share_docc" Name="docc">

platforms/Windows/shared/swift.en-us.wxl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
<String Id="Sdk_ProductName_arm64" Value="Swift Windows SDK (ARM64)" />
1717
<String Id="Sdk_ProductName_amd64" Value="Swift Windows SDK (AMD64)" />
1818
<String Id="Sdk_ProductName_x86" Value="Swift Windows SDK (X86)" />
19+
<String Id="Android_Sdk_arm64" Value="Swift Android SDK (ARM64)" />
20+
<String Id="Android_Sdk_amd64" Value="Swift Android SDK (AMD64)" />
21+
<String Id="Android_Sdk_arm" Value="Swift Android SDK (ARM)" />
22+
<String Id="Android_Sdk_x86" Value="Swift Android SDK (X86)" />
1923
<String Id="BundleName" Value="Swift Developer Toolkit" />
2024
<String Id="ManufacturerName" Value="swift.org" />
2125

0 commit comments

Comments
 (0)