Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec2df0e3 authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

feat(ci): add Rust + cargo-ndk toolchain for Android builds

parent 4acbca17
Loading
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -2,13 +2,17 @@ FROM ubuntu:24.04

# Global Android SDK arguments and environment variables
ARG ANDROID_SDK_VERSION=14742923
ARG RUST_TOOLCHAIN=stable
ARG ANDROID_NDK_DEFAULT_VERSION=29.0.14206865
ARG CARGO_NDK_VERSION=4.1.2
ENV ANDROID_SDK_ROOT="/sdk"
ENV ANDROID_HOME="/sdk"
ENV ANDROID_NDK="/sdk/ndk/"
ENV ANDROID_NDK="/sdk/ndk/${ANDROID_NDK_DEFAULT_VERSION}"
ENV ANDROID_NDK_HOME="${ANDROID_NDK}"
ARG ANDROID_CMDLINE_TOOLS_BIN="${ANDROID_SDK_ROOT}/cmdline-tools/tools/bin"

# Add Gradle and SDK tools to the PATH
ENV PATH="$PATH:${ANDROID_CMDLINE_TOOLS_BIN}/:${ANDROID_HOME}/platform-tools/:${ANDROID_HOME}/build-tools/35.0.0/"
ENV PATH="$PATH:${ANDROID_CMDLINE_TOOLS_BIN}/:${ANDROID_HOME}/platform-tools/:${ANDROID_HOME}/build-tools/35.0.0/:/root/.cargo/bin"

# Setup distribution and install required distribution packages
ENV DEBIAN_FRONTEND=noninteractive
@@ -21,9 +25,9 @@ RUN dpkg --add-architecture i386 && \

RUN apt-get -qq update && \
    apt-get install -qqy --no-install-recommends \
      aapt apksigner autoconf automake cmake curl gcc git-core git-lfs \
      aapt apksigner autoconf automake clang cmake curl gcc git-core git-lfs \
      jq libpcaudio-dev libsonic-dev libstdc++6:i386 libc6-i386 \
      libtool locales make openjdk-11-jdk openjdk-17-jdk \
      libclang-dev libssl-dev libtool locales make openjdk-11-jdk openjdk-17-jdk \
      openjdk-21-jdk openjdk-25-jdk openjdk-8-jdk openssh-client pkg-config \
      python3 python3-bs4 python3-requests unzip wget zip zlib1g:i386

@@ -38,6 +42,12 @@ ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
RUN rm -f /etc/ssl/certs/java/cacerts; \
    /var/lib/dpkg/info/ca-certificates-java.postinst configure

RUN curl -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain ${RUST_TOOLCHAIN} && \
    rustup target add aarch64-linux-android && \
    cargo install --locked cargo-ndk --version ${CARGO_NDK_VERSION} && \
    cargo --version && \
    cargo ndk --version

# Download and install SDK command-line tools
RUN mkdir -p ${ANDROID_SDK_ROOT}/cmdline-tools && \
    wget -q https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_VERSION}_latest.zip && \
+4 −4
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ This repo contains 4 images slim, full, chromium and ai.

The slim image is small in size and can be used for tasks like updating projects from upstream, running rsync tasks, etc. As those tasks doesn't need many packages therefore slim docker image can be used

The full image is used to build android apps. So it contains packages like python, java and android sdk.
The full image is used to build android apps. So it contains packages like python, java, rust and android sdk.

The chromium image is used to build our browser.

+1 −0
Original line number Diff line number Diff line
build-tools;35.0.0
ndk;29.0.14206865
ndk;25.2.9519653
platforms;android-34
platforms;android-35