Skip to content

Commit 3ad5ace

Browse files
committed
ci: Revamp Android SDK cache, and update it timely
1 parent e988bc7 commit 3ad5ace

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.cirrus.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
5151
<< : *BASE_TEMPLATE
5252
<< : *MAIN_TEMPLATE
5353

54-
depends_sdk_cache_template: &DEPENDS_SDK_CACHE_TEMPLATE
55-
depends_sdk_cache:
56-
folder: "depends/sdk-sources"
57-
5854
compute_credits_template: &CREDITS_TEMPLATE
5955
# https://cirrus-ci.org/pricing/#compute-credits
6056
# Only use credits for pull requests to the main repo
@@ -300,8 +296,10 @@ task:
300296

301297
task:
302298
name: 'ARM64 Android APK [focal]'
303-
<< : *DEPENDS_SDK_CACHE_TEMPLATE
304299
<< : *BASE_TEMPLATE
300+
android_sdk_cache:
301+
folder: "depends/SDKs/android"
302+
fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=22.1.7171670"
305303
depends_sources_cache:
306304
folder: "depends/sources"
307305
fingerprint_script: git rev-list -1 HEAD ./depends

ci/test/05_before_script.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ]
2626
DOCKER_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH"
2727
fi
2828

29-
if [ -n "$ANDROID_TOOLS_URL" ]; then
30-
ANDROID_TOOLS_PATH=$DEPENDS_DIR/sdk-sources/android-tools.zip
31-
32-
DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
29+
if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then
30+
ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip
31+
if [ ! -f "$ANDROID_TOOLS_PATH" ]; then
32+
DOCKER_EXEC curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH"
33+
fi
3334
DOCKER_EXEC mkdir -p "${ANDROID_HOME}/cmdline-tools"
3435
DOCKER_EXEC unzip -o "$ANDROID_TOOLS_PATH" -d "${ANDROID_HOME}/cmdline-tools"
3536
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}\""

0 commit comments

Comments
 (0)