1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-27 23:19:27 +01:00

43 lines
940 B
Bash
Raw Normal View History

2015-11-25 21:13:11 +08:00
#!/bin/bash
2015-11-26 11:12:16 +08:00
project_dir=`pwd`
2015-11-26 10:37:07 +08:00
local_opt_dir="${HOME}/.local/opt"
ndk_name="android-ndk-r10e"
ndk_install_dest="${local_opt_dir}/${ndk_name}"
2015-11-26 11:12:16 +08:00
echo "Adding NDK install path to ${project_dir}"
echo "ndk.dir=${ndk_install_dest}" >> ${project_dir}/local.properties
2015-11-26 11:06:08 +08:00
if [ -d ${ndk_install_dest} ]; then
echo "NDK already installed in ${ndk_install_dest}"
exit
fi
if [ ! -d ${local_opt_dir} ]; then
mkdir -p ${local_opt_dir}
2015-11-26 10:37:07 +08:00
fi
cd ${local_opt_dir}
2015-11-25 21:13:11 +08:00
if [ `uname -m` = x86_64 ];
then
2015-11-26 10:37:07 +08:00
ndk_installer_name="${ndk_name}-linux-x86_64.bin"
2015-11-25 21:13:11 +08:00
else
2015-11-26 10:37:07 +08:00
ndk_installer_name="${ndk_name}-linux-x86.bin"
2015-11-25 21:13:11 +08:00
fi
2015-11-26 11:06:08 +08:00
echo "Downloading NDK installer ${ndk_installer_name}"
2015-11-26 10:37:07 +08:00
wget "http://dl.google.com/android/ndk/${ndk_installer_name}"
chmod +x ${ndk_installer_name}
2015-11-26 11:06:08 +08:00
echo "Installing NDK installer ${ndk_installer_name}"
2015-11-26 10:44:11 +08:00
./${ndk_installer_name} -y 1>/dev/null
2015-11-26 10:37:07 +08:00
2015-11-26 11:06:08 +08:00
echo "Removing installed NDK installer ${ndk_installer_name}"
2015-11-26 10:37:07 +08:00
rm ${ndk_installer_name}