@@ -35,6 +35,9 @@ The debug information format for Swift code: dwarf or codeview.
35
35
. PARAMETER AndroidAPILevel
36
36
The API Level to target when building the Android SDKs
37
37
38
+ . PARAMETER Android
39
+ When set, build android SDKs.
40
+
38
41
. PARAMETER AndroidSDKs
39
42
An array of architectures for which the Android Swift SDK should be built.
40
43
@@ -106,14 +109,15 @@ param(
106
109
[string ] $CDebugFormat = " dwarf" ,
107
110
[string ] $SwiftDebugFormat = " dwarf" ,
108
111
[string ] $AndroidAPILevel = 28 ,
109
- [string []] $AndroidSDKs = @ (" aarch64 " , " armv7 " , " i686 " , " x86_64 " ),
112
+ [string []] $AndroidSDKs = @ (),
110
113
[string []] $WindowsSDKs = @ (" X64" , " X86" , " Arm64" ),
111
114
[string ] $ProductVersion = " 0.0.0" ,
112
115
[string ] $PinnedBuild = " " ,
113
116
[string ] $PinnedSHA256 = " " ,
114
117
[string ] $PythonVersion = " 3.9.10" ,
115
118
[string ] $AndroidNDKVersion = " r26b" ,
116
119
[string ] $WinSDKVersion = " " ,
120
+ [switch ] $Android = $false ,
117
121
[switch ] $SkipBuild = $false ,
118
122
[switch ] $SkipRedistInstall = $false ,
119
123
[switch ] $SkipPackaging = $false ,
@@ -177,11 +181,20 @@ if (-not (Test-Path $python)) {
177
181
}
178
182
}
179
183
184
+ if ($Android -and ($AndroidSDKs.Length -eq 0 )) {
185
+ # Enable all android SDKs by default.
186
+ $AndroidSDKs = @ (" aarch64" , " armv7" , " i686" , " x86_64" )
187
+ }
180
188
# Work around limitations of cmd passing in array arguments via powershell.exe -File
181
189
if ($AndroidSDKs.Length -eq 1 ) { $AndroidSDKs = $AndroidSDKs [0 ].Split(" ," ) }
182
190
if ($WindowsSDKs.Length -eq 1 ) { $WindowsSDKs = $WindowsSDKs [0 ].Split(" ," ) }
183
191
if ($Test.Length -eq 1 ) { $Test = $Test [0 ].Split(" ," ) }
184
192
193
+ if ($AndroidSDKs.Length -gt 0 ) {
194
+ # Always enable android when one of the SDKs is specified.
195
+ $Android = $true
196
+ }
197
+
185
198
if ($Test -contains " *" ) {
186
199
# Explicitly don't include llbuild yet since tests are known to fail on Windows
187
200
$Test = @ (" swift" , " dispatch" , " foundation" , " xctest" )
@@ -344,7 +357,7 @@ $AndroidSDKArchs = @($AndroidSDKs | ForEach-Object {
344
357
default { throw " Unknown architecture $_ " }
345
358
}
346
359
})
347
- if ($AndroidSDKArchs .count -gt 0 ) {
360
+ if ($Android ) {
348
361
if ($HostArch -ne $ArchX64 ) {
349
362
throw " Unsupported host architecture for building android SDKs"
350
363
}
@@ -666,7 +679,7 @@ function Fetch-Dependencies {
666
679
Download- Python $BuildArchName
667
680
}
668
681
669
- if ($AndroidSDKArchs .count -gt 0 ) {
682
+ if ($Android ) {
670
683
# Only a specific NDK version is supported right now.
671
684
if ($AndroidNDKVersion -ne " r26b" ) {
672
685
throw " Unsupported Android NDK version"
0 commit comments