You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.8 KiB

#!/bin/bash
cd "$(dirname "$0")"
clone() {
mkdir -p $1
pushd $1
git init
git config advice.detachedHead false
git fetch --depth=1 $2 $3
git checkout FETCH_HEAD
popd
}
3 years ago
# Commit hashes and sdk versions from https://android.googlesource.com/platform/manifest/+/refs/heads/androidx-main/default.xml
3 years ago
downloadLinuxSDK() {
3 years ago
clone ../prebuilts/fullsdk-linux/platforms/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-31 master
clone ../prebuilts/fullsdk-linux/sources/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-31 master
clone ../prebuilts/fullsdk-linux/ndk https://android.googlesource.com/toolchain/prebuilts/ndk/r21 master
4 years ago
clone ../prebuilts/fullsdk-linux/build-tools/30.0.3 https://android.googlesource.com/platform/prebuilts/fullsdk-linux/build-tools/30.0.3 master
clone ../prebuilts/fullsdk-linux/platform-tools https://android.googlesource.com/platform/prebuilts/fullsdk-linux/platform-tools master
clone ../prebuilts/fullsdk-linux/tools https://android.googlesource.com/platform/prebuilts/fullsdk-linux/tools master
clone ../prebuilts/fullsdk-linux/cmake https://android.googlesource.com/platform/prebuilts/cmake/linux-x86 de5fa1c66d3bdcbf2bbc62d2504ec6b0b0fb74e1
}
downloadMacOsSDK() {
3 years ago
clone ../prebuilts/fullsdk-darwin/platforms/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/platforms/android-31 master
clone ../prebuilts/fullsdk-darwin/sources/android-31 https://android.googlesource.com/platform/prebuilts/fullsdk/sources/android-31 master
clone ../prebuilts/fullsdk-darwin/ndk https://android.googlesource.com/toolchain/prebuilts/ndk-darwin/r21 master
4 years ago
clone ../prebuilts/fullsdk-darwin/build-tools/30.0.3 https://android.googlesource.com/platform/prebuilts/fullsdk-darwin/build-tools/30.0.3 master
clone ../prebuilts/fullsdk-darwin/platform-tools https://android.googlesource.com/platform/prebuilts/fullsdk-darwin/platform-tools master
clone ../prebuilts/fullsdk-darwin/tools https://android.googlesource.com/platform/prebuilts/fullsdk-darwin/tools master
4 years ago
clone ../prebuilts/fullsdk-darwin/cmake https://android.googlesource.com/platform/prebuilts/cmake/darwin-x86 fc59035d8c856055f2a263dc8a2f9de96c959cc2
}
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
downloadLinuxSDK
elif [[ "$OSTYPE" == "darwin"* ]]; then
downloadMacOsSDK
elif [[ "$OSTYPE" == "cygwin" ]]; then
echo "Please download Android SDK manually (https://developer.android.com/studio)"
elif [[ "$OSTYPE" == "msys" ]]; then
echo "Please download Android SDK manually (https://developer.android.com/studio)"
elif [[ "$OSTYPE" == "win32" ]]; then
echo "Please download Android SDK manually (https://developer.android.com/studio)"
else
echo "Unknown OS"
fi