monado/.gitlab-ci/install-android-sdk.sh
Korcan Hussein ae37c1bf29 gradle: Upgrade gradle and packages
* Upgrades the gradle version (using AGP upgrade assistant)
* Upgrades android package dependencies to latest versions (using project settings upgrade tool)
* Bump compile platform SDK level to 34 (required for package updates)
* Bump java src compatibility version (required for api level 34)
* Fix deprecated warnings
* Code compile fixes to account for package changes
* explicitly specify cmake version
* bump NDK to latest LTS version

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2270>
2024-07-03 19:28:53 +00:00

43 lines
1.4 KiB
Bash
Executable file

#!/usr/bin/env bash
# Copyright 2022, Collabora, Ltd. and the Monado contributors
# SPDX-License-Identifier: BSL-1.0
##
#######################################################
# GENERATED - DO NOT EDIT #
# see .gitlab-ci/install-android-sdk.sh.jinja instead #
#######################################################
##
# Partially inspired by https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/
set -eo pipefail
VERSION=11076708
ROOT=${ROOT:-/opt/android-sdk}
ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-34}
ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-34.0.0}
mkdir -p "$ROOT"
FN=commandlinetools-linux-${VERSION}_latest.zip
wget https://dl.google.com/android/repository/$FN
unzip $FN -d "$ROOT/extract"
mkdir -p "$ROOT/cmdline-tools"
mv "$ROOT/extract/cmdline-tools/" "$ROOT/cmdline-tools/latest/"
mv "$ROOT/extract/" "$ROOT/cmdline-tools/"
SDKMANAGER=$ROOT/cmdline-tools/latest/bin/sdkmanager
echo "Installing the Android compile SDK platform android-${ANDROID_COMPILE_SDK}"
echo y | $SDKMANAGER "platforms;android-${ANDROID_COMPILE_SDK}" >> /dev/null
echo "Installing the Android platform tools"
echo y | $SDKMANAGER "platform-tools" >> /dev/null
echo "Installing the Android build tools ${ANDROID_BUILD_TOOLS}"
echo y | $SDKMANAGER "build-tools;${ANDROID_BUILD_TOOLS}" >> /dev/null
set +o pipefail
yes | $SDKMANAGER --licenses
set -o pipefail