Add full offline Android Gradle Plugin dependency cache

This commit is contained in:
lendry
2026-06-26 21:56:56 +03:00
parent 07df6eacf1
commit ea204a4d38
6 changed files with 98 additions and 12 deletions

View File

@@ -7,8 +7,6 @@ ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV PATH=/root/.cargo/bin:/opt/android-sdk/cmdline-tools/latest/bin:/opt/android-sdk/platform-tools:/usr/local/bin:$PATH
ARG NPM_REGISTRY=https://registry.npmjs.org
ARG PUBLIC_API_URL=http://localhost:3000
ARG PUBLIC_FRONTEND_URL=http://localhost:3002
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
@@ -24,9 +22,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN if [ ! -d "${ANDROID_HOME}" ] && [ -d /opt/android-sdk-linux ]; then ln -s /opt/android-sdk-linux "${ANDROID_HOME}"; fi \
&& (sdkmanager --version || true) \
&& test -d "${ANDROID_HOME}/platforms" \
&& test -d "${ANDROID_HOME}/platforms/android-35" \
&& test -d "${ANDROID_HOME}/build-tools" \
&& test -d "${ANDROID_HOME}/platform-tools"
&& test -d "${ANDROID_HOME}/platform-tools" \
&& test -d "${ANDROID_HOME}/ndk"
RUN curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get update \
@@ -62,10 +61,7 @@ RUN sed -i 's/\r$//' tauri_app/docker/*.sh \
ENV ANDROID_AGP_LOCAL_REPO=/opt/android-agp-maven
ENV GRADLE_USER_HOME=/root/.gradle
RUN /workspace/tauri_app/docker/prefetch-android-agp.sh
ENV VITE_API_URL=${PUBLIC_API_URL}
ENV VITE_FRONTEND_URL=${PUBLIC_FRONTEND_URL}
RUN /workspace/tauri_app/docker/warm-gradle-cache.sh
RUN /workspace/tauri_app/docker/prefetch-android-agp.sh \
&& /workspace/tauri_app/docker/verify-offline-agp.sh
CMD ["build-android-apk"]