mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
[Windows] Remove ndk-bundle (#5927)
* Remove ndk-bundle from windows * Remove NDK-related variables
This commit is contained in:
@@ -109,7 +109,6 @@ Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager `
|
||||
|
||||
# NDKs
|
||||
$ndkMajorVersions = $androidToolset.ndk.versions
|
||||
$ndkDefaultMajorVersion = $androidToolset.ndk.default
|
||||
$ndkLatestMajorVersion = $ndkMajorVersions | Select-Object -Last 1
|
||||
|
||||
$androidNDKs = $ndkMajorVersions | Foreach-Object {
|
||||
@@ -120,27 +119,11 @@ Install-AndroidSDKPackages -AndroidSDKManagerPath $sdkManager `
|
||||
-AndroidSDKRootPath $sdkRoot `
|
||||
-AndroidPackages $androidNDKs
|
||||
|
||||
$ndkDefaultVersion = ($androidNDKs | Where-Object { $_ -match "ndk;$ndkDefaultMajorVersion" }).Split(';')[1]
|
||||
$ndkLatestVersion = ($androidNDKs | Where-Object { $_ -match "ndk;$ndkLatestMajorVersion" }).Split(';')[1]
|
||||
|
||||
# Android NDK root path.
|
||||
$ndkRoot = "$sdkRoot\ndk-bundle"
|
||||
# This changes were added due to incompatibility with android ndk-bundle (ndk;22.0.7026061).
|
||||
# Link issue virtual-environments: https://github.com/actions/virtual-environments/issues/2481
|
||||
# Link issue xamarin-android: https://github.com/xamarin/xamarin-android/issues/5526
|
||||
New-Item -Path $ndkRoot -ItemType SymbolicLink -Value "$sdkRoot\ndk\$ndkDefaultVersion"
|
||||
|
||||
if (Test-Path $ndkRoot) {
|
||||
setx ANDROID_HOME $sdkRoot /M
|
||||
setx ANDROID_SDK_ROOT $sdkRoot /M
|
||||
setx ANDROID_NDK_HOME $ndkRoot /M
|
||||
setx ANDROID_NDK_PATH $ndkRoot /M
|
||||
setx ANDROID_NDK_ROOT $ndkRoot /M
|
||||
(Get-Content -Encoding UTF8 "${ndkRoot}\ndk-build.cmd").replace('%~dp0\build\ndk-build.cmd','"%~dp0\build\ndk-build.cmd"')|Set-Content -Encoding UTF8 "${ndkRoot}\ndk-build.cmd"
|
||||
} else {
|
||||
Write-Host "Default NDK $ndkDefaultVersion is not installed at path $ndkRoot"
|
||||
exit 1
|
||||
}
|
||||
# Create env variables
|
||||
setx ANDROID_HOME $sdkRoot /M
|
||||
setx ANDROID_SDK_ROOT $sdkRoot /M
|
||||
|
||||
$ndkLatestPath = "$sdkRoot\ndk\$ndkLatestVersion"
|
||||
if (Test-Path $ndkLatestPath) {
|
||||
|
||||
Reference in New Issue
Block a user