Skip to content

Commit 511e879

Browse files
committed
[Android] fix NDK extract location
The Android NDK is being extracted with an extra intermediate directory: $BinaryCache\android-ndk-r26b\android-ndk-r26b The Android build fails because it expects the NDK contents to live immediately under the directory: $BinaryCache\android-ndk-r26b The extra android-ndk-r26b sub-dir comes from the NDK zip archive itself, which we have no control over. To work-around, allow callers of Extract-ZipFile to control whether or not it should create the extraction sub-dir. Override the default behavior for NDK extraction only.
1 parent f88da38 commit 511e879

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

utils/build.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ function Fetch-Dependencies {
629629
(
630630
[string]$ZipFileName,
631631
[string]$BinaryCache,
632-
[string]$ExtractPath
632+
[string]$ExtractPath,
633+
[bool]$CreateExtractPath = $true
633634
)
634635

635636
$source = Join-Path -Path $BinaryCache -ChildPath $ZipFileName
@@ -646,11 +647,14 @@ function Fetch-Dependencies {
646647
}
647648
}
648649

650+
$destination = if ($CreateExtractPath) { $destination } else { $BinaryCache }
651+
649652
Write-Output "Extracting '$ZipFileName' ..."
650653
New-Item -ItemType Directory -ErrorAction Ignore -Path $BinaryCache | Out-Null
651654
Expand-Archive -Path $source -DestinationPath $destination -Force
652655
}
653656

657+
654658
function Extract-Toolchain {
655659
param
656660
(
@@ -727,7 +731,7 @@ function Fetch-Dependencies {
727731
$NDKHash = "A478D43D4A45D0D345CDA6BE50D79642B92FB175868D9DC0DFC86181D80F691E"
728732
DownloadAndVerify $NDKURL "$BinaryCache\android-ndk-$AndroidNDKVersion-windows.zip" $NDKHash
729733

730-
Extract-ZipFile -ZipFileName "android-ndk-$AndroidNDKVersion-windows.zip" -BinaryCache $BinaryCache -ExtractPath "android-ndk-$AndroidNDKVersion"
734+
Extract-ZipFile -ZipFileName "android-ndk-$AndroidNDKVersion-windows.zip" -BinaryCache $BinaryCache -ExtractPath "android-ndk-$AndroidNDKVersion" -CreateExtractPath $false
731735
}
732736

733737
if ($WinSDKVersion) {

0 commit comments

Comments
 (0)