File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,25 @@ find_android_sdk() {
3535 fi
3636}
3737
38- # Function to find the latest NDK version
38+ # Function to find the NDK version (from tools.versions.toml or latest)
3939find_ndk_version () {
4040 local sdk_path=" $1 "
4141 local ndk_dir=" $sdk_path /ndk"
42-
42+ local version_catalog=" ../gradle/tools.versions.toml"
43+
44+ # First, try to read NDK version from tools.versions.toml
45+ if [ -f " $version_catalog " ]; then
46+ local ndk_version=$( grep " ^ndk" " $version_catalog " | cut -d ' "' -f 2)
47+ if [ -n " $ndk_version " ] && [ -d " $ndk_dir /$ndk_version " ]; then
48+ echo " $ndk_version "
49+ return
50+ elif [ -n " $ndk_version " ]; then
51+ echo " ⚠️ Warning: NDK version $ndk_version specified in tools.versions.toml not found in $ndk_dir " >&2
52+ echo " Falling back to latest available version..." >&2
53+ fi
54+ fi
55+
56+ # Fall back to finding the latest version
4357 if [ -d " $ndk_dir " ]; then
4458 # Find the latest version (highest version number)
4559 ls -1 " $ndk_dir " | sort -V | tail -n 1
You can’t perform that action at this time.
0 commit comments