mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-24 10:28:10 +08:00
[macOS] Add Android NDK r23 (#4032)
This commit is contained in:
@@ -26,13 +26,14 @@ function get_full_ndk_version {
|
||||
|
||||
components=()
|
||||
|
||||
ANDROID_PLATFORM=($(get_toolset_value '.android.platform_min_version'))
|
||||
ANDROID_BUILD_TOOL=($(get_toolset_value '.android.build_tools_min_version'))
|
||||
ANDROID_PLATFORM=$(get_toolset_value '.android.platform_min_version')
|
||||
ANDROID_BUILD_TOOL=$(get_toolset_value '.android.build_tools_min_version')
|
||||
ANDROID_EXTRA_LIST=($(get_toolset_value '.android."extra-list"[]'))
|
||||
ANDROID_ADDON_LIST=($(get_toolset_value '.android."addon-list"[]'))
|
||||
ANDROID_ADDITIONAL_TOOLS=($(get_toolset_value '.android."additional-tools"[]'))
|
||||
ANDROID_NDK_MAJOR_LTS=($(get_toolset_value '.android.ndk.lts'))
|
||||
ANDROID_NDK_MAJOR_LATEST=($(get_toolset_value '.android.ndk.latest'))
|
||||
ANDROID_NDK_MAJOR_VERSIONS=($(get_toolset_value '.android.ndk."versions"[]'))
|
||||
ANDROID_NDK_MAJOR_DEFAULT=$(get_toolset_value '.android.ndk.default')
|
||||
ANDROID_NDK_MAJOR_LATEST=$(get_toolset_value '.android.ndk."versions"[-1]')
|
||||
# Get the latest command line tools from https://developer.android.com/studio#cmdline-tools
|
||||
ANDROID_OSX_SDK_URL="https://dl.google.com/android/repository/commandlinetools-mac-7302050_latest.zip"
|
||||
ANDROID_HOME=$HOME/Library/Android/sdk
|
||||
@@ -59,13 +60,17 @@ echo "Installing latest tools & platform tools..."
|
||||
echo y | $SDKMANAGER "tools" "platform-tools"
|
||||
|
||||
echo "Installing latest ndk..."
|
||||
ndkLtsLatest=$(get_full_ndk_version $ANDROID_NDK_MAJOR_LTS)
|
||||
ndkLatest=$(get_full_ndk_version $ANDROID_NDK_MAJOR_LATEST)
|
||||
echo y | $SDKMANAGER "ndk;$ndkLtsLatest" "ndk;$ndkLatest"
|
||||
for ndk_version in "${ANDROID_NDK_MAJOR_VERSIONS[@]}"
|
||||
do
|
||||
ndk_full_version=$(get_full_ndk_version $ndk_version)
|
||||
echo y | $SDKMANAGER "ndk;$ndk_full_version"
|
||||
done
|
||||
# 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
|
||||
ln -s $ANDROID_HOME/ndk/$ndkLtsLatest $ANDROID_HOME/ndk-bundle
|
||||
ndkDefault=$(get_full_ndk_version $ANDROID_NDK_MAJOR_DEFAULT)
|
||||
ndkLatest=$(get_full_ndk_version $ANDROID_NDK_MAJOR_LATEST)
|
||||
ln -s $ANDROID_HOME/ndk/$ndkDefault $ANDROID_HOME/ndk-bundle
|
||||
ANDROID_NDK_LATEST_HOME=$ANDROID_HOME/ndk/$ndkLatest
|
||||
echo "export ANDROID_NDK_LATEST_HOME=$ANDROID_NDK_LATEST_HOME" >> "${HOME}/.bashrc"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user