Skip to content

Commit c535265

Browse files
authored
[android] optionally include DS2 in Android SDK
Conditionally include DS2 in the Android SDK when building the MSI with `-p:ANDROID_INCLUDE_DS2=true` passed to `msbuild`. Has no impact on the generated installer if this property is not set.
1 parent dd33cf3 commit c535265

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

platforms/Windows/android_sdk/android_sdk.wixproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<DefineConstants>
99
$(DefineConstants);
10+
ANDROID_INCLUDE_DS2=$(ANDROID_INCLUDE_DS2);
1011
SwiftShimsPath=$(SwiftShimsPath);
1112
</DefineConstants>
1213
</PropertyGroup>

platforms/Windows/android_sdk/android_sdk.wxs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,31 @@
55
<?define ArchName = "arm64"?>
66
<?define ArchArchDir = "aarch64"?>
77
<?define ArchTriple = "aarch64-unknown-linux-android"?>
8+
<?define ArchTripleDir = "aarch64-unknown-linux-android"?>
89
<?elseif $(ProductArchitecture) = "x86_64"?>
910
<?define ArchName = "amd64"?>
1011
<?define ArchArchDir = "x86_64"?>
1112
<?define ArchTriple = "x86_64-unknown-linux-android"?>
13+
<?define ArchTripleDir = "x86_64-unknown-linux-android"?>
1214
<?elseif $(ProductArchitecture) = "armv7"?>
1315
<?define ArchName = "arm"?>
1416
<?define ArchArchDir = "armv7"?>
17+
<!--
18+
The Swift compiler outputs Android armv7 .swiftdoc, .swiftmodule, and
19+
.swiftinterface files with the name armv7-unknown-linux-android. Since the
20+
correct triple is armv7-unknown-linux-androideabi, define two constants to
21+
deal with the inconsistency.
22+
23+
TODO: consider updating Swift compiler to output file names matching the
24+
correct triple.
25+
-->
1526
<?define ArchTriple = "armv7-unknown-linux-android"?>
27+
<?define ArchTripleDir = "armv7-unknown-linux-androideabi"?>
1628
<?elseif $(ProductArchitecture) = "i686"?>
1729
<?define ArchName = "x86"?>
1830
<?define ArchArchDir = "i686"?>
1931
<?define ArchTriple = "i686-unknown-linux-android"?>
32+
<?define ArchTripleDir = "i686-unknown-linux-android"?>
2033
<?endif?>
2134

2235
<Package
@@ -79,6 +92,9 @@
7992
</Directory>
8093
</Directory>
8194
</Directory>
95+
<Directory Name="$(ArchTripleDir)">
96+
<Directory Id="Android_Library_ARCH_bin" Name="bin" />
97+
</Directory>
8298
</Directory>
8399
<Directory Name="SDKs">
84100
<!-- Android.sdk -->
@@ -156,6 +172,14 @@
156172
</Component>
157173
</ComponentGroup>
158174

175+
<ComponentGroup Id="DS2">
176+
<?if $(ANDROID_INCLUDE_DS2) == true ?>
177+
<Component Directory="Android_Library_ARCH_bin">
178+
<File Source="$(PLATFORM_ROOT)\Developer\Library\$(ArchTripleDir)\bin\ds2" />
179+
</Component>
180+
<?endif?>
181+
</ComponentGroup>
182+
159183
<ComponentGroup Id="SwiftRemoteMirror" Directory="AndroidSDK_usr_include_swift_SwiftRemoteMirror">
160184
<Component>
161185
<File Source="$(SDK_ROOT)\usr\include\swift\SwiftRemoteMirror\MemoryReaderInterface.h" />
@@ -1283,6 +1307,7 @@
12831307
<ComponentGroupRef Id="Registrar" />
12841308
<ComponentGroupRef Id="Configuration" />
12851309
<ComponentGroupRef Id="SwiftShims" />
1310+
<ComponentGroupRef Id="DS2" />
12861311

12871312
<ComponentGroupRef Id="VersionedDirectoryCleanup" />
12881313
</Feature>

0 commit comments

Comments
 (0)