From 41dca10ca7f6c360155edf2d1838c8df081f17f5 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Mon, 16 Dec 2024 15:20:15 +0100 Subject: [PATCH] Update android container and support gradle rust plugin --- android/docker/Dockerfile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/android/docker/Dockerfile b/android/docker/Dockerfile index bfe95668be44..dd8620cebb8d 100644 --- a/android/docker/Dockerfile +++ b/android/docker/Dockerfile @@ -36,14 +36,15 @@ ARG COMMAND_LINE_TOOLS_VERSION=11076708 \ COMMAND_LINE_TOOLS_SHA256_CHECKSUM=2d2d50857e4eb553af5a6dc3ad507a17adf43d115264b1afc116f95c92e5e258 # NDK and checksum from: https://github.com/android/ndk/wiki#supported-downloads -ARG NDK_VERSION=r27b \ - NDK_SHA1_CHECKSUM=6fc476b2e57d7c01ac0c95817746b927035b9749 \ - MIN_SDK_VERSION=26 +ARG NDK_VERSION_NAME=r27c \ + NDK_SHA1_CHECKSUM=090e8083a715fdb1a3e402d0763c388abb03fb4e \ + MIN_SDK_VERSION=26 \ + NDK_VERSION=27.2.12479018 ENV ANDROID_SDK_ROOT=/opt/android # ANDROID_HOME is kept for backwards compatibility ENV ANDROID_HOME=$ANDROID_SDK_ROOT -ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/android-ndk-${NDK_VERSION} +ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/${NDK_VERSION} ENV NDK_TOOLCHAIN_DIR=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin ENV GRADLE_USER_HOME=/root/.gradle @@ -67,6 +68,9 @@ ENV AR_x86_64_linux_android=${NDK_TOOLCHAIN_DIR}/llvm-ar \ CC_x86_64_linux_android=${NDK_TOOLCHAIN_DIR}/x86_64-linux-android${MIN_SDK_VERSION}-clang \ CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=${NDK_TOOLCHAIN_DIR}/x86_64-linux-android${MIN_SDK_VERSION}-clang +# Set up python3 path for the rust gradle plugin +ENV RUST_ANDROID_GRADLE_PYTHON_COMMAND=/usr/bin/python3 + # === Install/set up the image === RUN apt-get update -y && apt-get install -y \ @@ -97,9 +101,11 @@ RUN curl -sfLo /tmp/cmdline-tools.zip https://dl.google.com/android/repository/c RUN yes | $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager $SDK_VERSION $BUILD_TOOLS_VERSION "platform-tools" # Install Android NDK -RUN curl -sfLo /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux.zip && \ +RUN mkdir -p ${ANDROID_SDK_ROOT}/ndk && \ + curl -sfLo /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-${NDK_VERSION_NAME}-linux.zip && \ echo "$NDK_SHA1_CHECKSUM /tmp/ndk.zip" | sha1sum -c && \ - unzip -q /tmp/ndk.zip -d $ANDROID_SDK_ROOT && \ + unzip -q /tmp/ndk.zip -d /tmp && \ + mv /tmp/android-ndk-${NDK_VERSION_NAME} ${ANDROID_NDK_HOME} && \ rm /tmp/ndk.zip # Apply go patch required for Android