aboutsummaryrefslogtreecommitdiff
path: root/ci/test
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-11-25 19:32:22 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-11-25 21:23:34 +0200
commit3ad5ace351fc298a2f743dc3dd85e11fb1101751 (patch)
treeb808e4ff27040799c92d6362cf507ed15a61b5da /ci/test
parente988bc7f2e4919aa296f8de1f34cc6d7f6de8aae (diff)
downloadbitcoin-3ad5ace351fc298a2f743dc3dd85e11fb1101751.tar.xz
ci: Revamp Android SDK cache, and update it timely
Diffstat (limited to 'ci/test')
-rwxr-xr-xci/test/05_before_script.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh
index 4a54ce7eb8..d8c23bd26b 100755
--- a/ci/test/05_before_script.sh
+++ b/ci/test/05_before_script.sh
@@ -26,10 +26,11 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
fi
-if [ -n "$ANDROID_TOOLS_URL" ]; then
- ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip
-
- DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
+if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
+ ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip
+ if [ ! -f "$ANDROID_TOOLS_PATH" ]; then
+ DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
+ fi
DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools"
DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools"
DOCKER_EXEC "yes | ${ANDROID_HOME}/cmdline-tools/tools/bin/sdkmanager --install \"build-tools;${ANDROID_BUILD_TOOLS_VERSION}\" \"platform-tools\" \"platforms;android-${ANDROID_API_LEVEL}\" \"ndk;${ANDROID_NDK_VERSION}\""