mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[macOS] Install latest Android cmdline-tools (#5641)
* Install latest Android cmdline-tools * Use cmdlineToolsVersion variable
This commit is contained in:
committed by
GitHub
parent
82d552ac56
commit
fbbf35456f
@@ -35,7 +35,23 @@ ANDROID_NDK_MAJOR_VERSIONS=($(get_toolset_value '.android.ndk."versions"[]'))
|
|||||||
ANDROID_NDK_MAJOR_DEFAULT=$(get_toolset_value '.android.ndk.default')
|
ANDROID_NDK_MAJOR_DEFAULT=$(get_toolset_value '.android.ndk.default')
|
||||||
ANDROID_NDK_MAJOR_LATEST=$(get_toolset_value '.android.ndk."versions"[-1]')
|
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
|
# 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"
|
cmdlineToolsVersion=$(get_toolset_value '.android."cmdline-tools"')
|
||||||
|
if [[ $cmdlineToolsVersion == "latest" ]]; then
|
||||||
|
repositoryXmlUrl="https://dl.google.com/android/repository/repository2-1.xml"
|
||||||
|
download_with_retries $repositoryXmlUrl "/tmp" "repository2-1.xml"
|
||||||
|
cmdlineToolsVersion=$(
|
||||||
|
yq -p=xml \
|
||||||
|
'.sdk-repository.remotePackage[] | select(."+path" == "cmdline-tools;latest").archives.archive[].complete.url | select(contains("commandlinetools-mac"))' \
|
||||||
|
/tmp/repository2-1.xml
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ -z $cmdlineToolsVersion ]]; then
|
||||||
|
echo "Failed to parse latest command-line tools version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
ANDROID_OSX_SDK_URL="https://dl.google.com/android/repository/${cmdlineToolsVersion}"
|
||||||
ANDROID_HOME=$HOME/Library/Android/sdk
|
ANDROID_HOME=$HOME/Library/Android/sdk
|
||||||
ANDROID_OSX_SDK_FILE=tools-macosx.zip
|
ANDROID_OSX_SDK_FILE=tools-macosx.zip
|
||||||
|
|
||||||
|
|||||||
@@ -165,6 +165,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
|
"cmdline-tools": "latest",
|
||||||
"platform_min_version": "24",
|
"platform_min_version": "24",
|
||||||
"build_tools_min_version": "24.0.0",
|
"build_tools_min_version": "24.0.0",
|
||||||
"extra-list": [
|
"extra-list": [
|
||||||
|
|||||||
@@ -165,6 +165,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
|
"cmdline-tools": "latest",
|
||||||
"platform_min_version": "27",
|
"platform_min_version": "27",
|
||||||
"build_tools_min_version": "27.0.0",
|
"build_tools_min_version": "27.0.0",
|
||||||
"extra-list": [
|
"extra-list": [
|
||||||
|
|||||||
@@ -93,6 +93,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
|
"cmdline-tools": "latest",
|
||||||
"platform_min_version": "27",
|
"platform_min_version": "27",
|
||||||
"build_tools_min_version": "27.0.0",
|
"build_tools_min_version": "27.0.0",
|
||||||
"extra-list": [
|
"extra-list": [
|
||||||
|
|||||||
Reference in New Issue
Block a user