Merge branch 'setup_script_android_optional' into 'main'

Added ability to skip install of android SDK when running prerequisites...

Closes #240

See merge request veilid/veilid!81
This commit is contained in:
Christien Rioux 2023-07-18 22:17:42 +00:00
commit 78ae602ef2
2 changed files with 28 additions and 1 deletions

View File

@ -14,6 +14,12 @@ sudo apt install -y openjdk-11-jdk-headless iproute2 curl build-essential cmake
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -c clippy --profile default curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -c clippy --profile default
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
#ask if they want to install optional android sdk (and install if yes)
while true; do
read -p "Do you want to install Android SDK (optional) Y/N) " response
case $response in
[yY] ) echo Installing Android SDK...;
# Install Android SDK # Install Android SDK
mkdir $HOME/Android; mkdir $HOME/Android/Sdk mkdir $HOME/Android; mkdir $HOME/Android/Sdk
curl -o $HOME/Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip curl -o $HOME/Android/cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip
@ -29,5 +35,15 @@ export PATH=\$PATH:\$HOME/Android/Sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/
export ANDROID_NDK_HOME=\$HOME/Android/Sdk/ndk/25.1.8937393 export ANDROID_NDK_HOME=\$HOME/Android/Sdk/ndk/25.1.8937393
export ANDROID_SDK_ROOT=\$HOME/Android/Sdk export ANDROID_SDK_ROOT=\$HOME/Android/Sdk
END END
break ;;
[nN] ) echo Skipping Android SDK;
cat >> $HOME/.profile <<END
source "\$HOME/.cargo/env"
END
break;;
echo Exit and reopen the shell and continue with ./setup_linux.sh * ) echo invalid response;;
esac
done
echo Complete! Exit and reopen the shell and continue with ./setup_linux.sh

View File

@ -12,6 +12,10 @@ if [ "$(lsb_release -d | grep -qEi 'debian|buntu|mint')" ]; then
echo Not a supported Linux echo Not a supported Linux
exit 1 exit 1
fi fi
read -p "Did you install Android SDK? Y/N " response
while true; do
case $response in
[yY] ) echo Checking android setup...;
# ensure ANDROID_SDK_ROOT is defined and exists # ensure ANDROID_SDK_ROOT is defined and exists
if [ -d "$ANDROID_SDK_ROOT" ]; then if [ -d "$ANDROID_SDK_ROOT" ]; then
@ -68,7 +72,14 @@ else
echo 'adb is not available in the path' echo 'adb is not available in the path'
exit 1 exit 1
fi fi
break;;
[nN] ) echo Skipping android SDK config check...;
break;;
* ) echo invalid response;;
esac
done
# ensure rustup is installed # ensure rustup is installed
if command -v rustup &> /dev/null; then if command -v rustup &> /dev/null; then
echo '[X] rustup is available in the path' echo '[X] rustup is available in the path'