Docker android: update SDK and NDK

This commit is contained in:
malinero 2021-07-09 02:25:40 +02:00
parent fa55575973
commit 131154ba80

View file

@ -1,10 +1,10 @@
FROM debian:stretch FROM debian:stretch
ARG THREADS=1 ARG THREADS=1
ARG ANDROID_NDK_REVISION=21d ARG ANDROID_NDK_REVISION=21e
ARG ANDROID_NDK_HASH=bcf4023eb8cb6976a4c7cff0a8a8f145f162bf4d ARG ANDROID_NDK_HASH=c3ebc83c96a4d7f539bd72c241b2be9dcd29bda9
ARG ANDROID_SDK_REVISION=4333796 ARG ANDROID_SDK_REVISION=7302050_latest
ARG ANDROID_SDK_HASH=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9 ARG ANDROID_SDK_HASH=7a00faadc0864f78edd8f4908a629a46d622375cbe2e5814e82934aebecdb622
ARG QT_VERSION=5.15.2 ARG QT_VERSION=5.15.2
WORKDIR /opt/android WORKDIR /opt/android
@ -15,7 +15,7 @@ ENV ANDROID_API=android-${ANDROID_NATIVE_API_LEVEL}
ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang ENV ANDROID_CLANG=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang
ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++ ENV ANDROID_CLANGPP=aarch64-linux-android${ANDROID_NATIVE_API_LEVEL}-clang++
ENV ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r${ANDROID_NDK_REVISION} ENV ANDROID_NDK_ROOT=${WORKDIR}/android-ndk-r${ANDROID_NDK_REVISION}
ENV ANDROID_SDK_ROOT=${WORKDIR}/tools ENV ANDROID_SDK_ROOT=${WORKDIR}/cmdline-tools
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
ENV PATH=${JAVA_HOME}/bin:${PATH} ENV PATH=${JAVA_HOME}/bin:${PATH}
ENV PREFIX=${WORKDIR}/prefix ENV PREFIX=${WORKDIR}/prefix
@ -26,16 +26,19 @@ RUN apt-get update \
libssl-dev libstdc++6 libtinfo5 libtool libz1 openjdk-8-jdk-headless openjdk-8-jre-headless pkg-config python3 \ libssl-dev libstdc++6 libtinfo5 libtool libz1 openjdk-8-jdk-headless openjdk-8-jre-headless pkg-config python3 \
unzip wget unzip wget
RUN wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_REVISION}.zip \ RUN PACKAGE_NAME=commandlinetools-linux-${ANDROID_SDK_REVISION}.zip \
&& unzip -q sdk-tools-linux-${ANDROID_SDK_REVISION}.zip \ && wget -q https://dl.google.com/android/repository/${PACKAGE_NAME} \
&& rm -f sdk-tools-linux-${ANDROID_SDK_REVISION}.zip && echo "${ANDROID_SDK_HASH} ${PACKAGE_NAME}" | sha256sum -c \
&& unzip -q ${PACKAGE_NAME} \
&& rm -f ${PACKAGE_NAME}
RUN wget -q https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip \ RUN PACKAGE_NAME=android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip \
&& unzip -q android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip \ && wget -q https://dl.google.com/android/repository/${PACKAGE_NAME} \
&& rm -f android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && echo "${ANDROID_NDK_HASH} ${PACKAGE_NAME}" | sha1sum -c \
&& unzip -q ${PACKAGE_NAME} \
&& rm -f ${PACKAGE_NAME}
RUN cd ${ANDROID_SDK_ROOT} && echo y | ./bin/sdkmanager "platform-tools" "platforms;${ANDROID_API}" "tools" > /dev/null RUN echo y | ${ANDROID_SDK_ROOT}/bin/sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "build-tools;28.0.3" "platforms;${ANDROID_API}" "tools" > /dev/null
RUN cp -r ${WORKDIR}/platforms ${WORKDIR}/platform-tools ${ANDROID_SDK_ROOT}
ENV HOST_PATH=${PATH} ENV HOST_PATH=${PATH}
ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH} ENV PATH=${TOOLCHAIN_DIR}/aarch64-linux-android/bin:${TOOLCHAIN_DIR}/bin:${PATH}
@ -196,12 +199,6 @@ RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git \
&& make -j${THREADS} install \ && make -j${THREADS} install \
&& rm -rf $(pwd) && rm -rf $(pwd)
RUN cd tools \
&& wget -q http://dl-ssl.google.com/android/repository/tools_r25.2.5-linux.zip \
&& unzip -q tools_r25.2.5-linux.zip \
&& rm -f tools_r25.2.5-linux.zip \
&& echo y | ${ANDROID_SDK_ROOT}/tools/android update sdk --no-ui --all --filter build-tools-28.0.3
RUN git clone -b v3.19.7 --depth 1 https://github.com/Kitware/CMake \ RUN git clone -b v3.19.7 --depth 1 https://github.com/Kitware/CMake \
&& cd CMake \ && cd CMake \
&& git reset --hard 22612dd53a46c7f9b4c3f4b7dbe5c78f9afd9581 \ && git reset --hard 22612dd53a46c7f9b4c3f4b7dbe5c78f9afd9581 \
@ -226,6 +223,7 @@ CMD set -ex \
-DBoost_USE_STATIC_RUNTIME=ON \ -DBoost_USE_STATIC_RUNTIME=ON \
-DLRELEASE_PATH="${PREFIX}/bin" \ -DLRELEASE_PATH="${PREFIX}/bin" \
-DQT_ANDROID_APPLICATION_BINARY="monero-wallet-gui" \ -DQT_ANDROID_APPLICATION_BINARY="monero-wallet-gui" \
-DANDROID_SDK="${ANDROID_SDK_ROOT}" \
-DWITH_SCANNER=ON \ -DWITH_SCANNER=ON \
../../.. \ ../../.. \
&& PATH=${HOST_PATH} make generate_translations_header \ && PATH=${HOST_PATH} make generate_translations_header \