Files
build-containers/Dockerfile.android
Rémi Verschelde 0a63061960 Mono: Allow specifying fixed git hash and pretty image version
Specifying only a branch like '2019-08' is problematic if upstream commits
something between the builds of two containers.

We could make a tarball in the first container build and reuse that, but we
need the flexibility of Git for some patching in the Android and JavaScript
builds, so instead we allow specifying a git tree-ish as the third argument.

We can therefore also give a pretty version string to use for the image name
as second argument, e.g. 6.6.0.160 for bef1e6335812d32f8eab648c0228fc624b9f8357.

As we can't `git clone` a commit hash directly, we still need to provide both
branch name and then commit hash for this use case.
2019-12-04 11:50:04 +01:00

40 lines
1.6 KiB
Docker

ARG img_version
FROM godot-mono:${img_version}
ARG mono_version
ARG mono_commit
RUN if [ -z "${mono_version}" ]; then echo -e "\n\nargument mono-version is mandatory!\n\n"; exit 1; fi && \
dnf -y install --setopt=install_weak_deps=False \
gcc gcc-c++ java-1.8.0-openjdk-devel ncurses-compat-libs && \
dnf clean all && \
mkdir sdk && cd sdk && \
curl -LO https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && \
unzip sdk-tools-linux-4333796.zip && \
rm sdk-tools-linux-4333796.zip && \
yes | tools/bin/sdkmanager --licenses && \
tools/bin/sdkmanager ndk-bundle 'build-tools;28.0.3' 'platforms;android-28' 'cmake;3.10.2.4988404'
ENV ANDROID_HOME=/root/sdk/
ENV ANDROID_NDK_ROOT=/root/sdk/ndk-bundle/
RUN git clone https://github.com/mono/mono --branch ${mono_version} --single-branch && \
cd /root/mono && \
if [ ! -z "${mono_commit}" ]; then git checkout ${mono_commit}; fi && \
git submodule update --init && \
export MONO_SOURCE_ROOT=/root/mono && \
export make="make -j" && \
git clone https://github.com/godotengine/godot-mono-builds /root/godot-mono-builds && \
cd /root/godot-mono-builds && \
git checkout bd129da22b8b9c96f3e8b07af348cc5fb61504bf && \
python3 patch_mono.py && \
python3 android.py configure --target=all-runtime && \
python3 android.py make --target=all-runtime && \
cd /root/mono && git clean -fdx && NOCONFIGURE=1 ./autogen.sh && \
cd /root/godot-mono-builds && \
python3 bcl.py make --product=android && \
cd /root && \
rm -rf /root/mono /root/godot-mono-builds
CMD /bin/bash