diff --git a/build-all.sh b/build-all.sh index d88643a..8c490ab 100755 --- a/build-all.sh +++ b/build-all.sh @@ -13,5 +13,5 @@ set -e ./build-one.sh openxr 20231010.1 "$@" ./build-one.sh openxr-sdk 20230614 "$@" ./build-one.sh openxr-pregenerated-sdk 20230822 "$@" - ./build-one.sh openxr-android 20231206 "$@" + ./build-one.sh openxr-android 20240312 "$@" ) diff --git a/build-one.sh b/build-one.sh index 4a091c9..dc4163c 100755 --- a/build-one.sh +++ b/build-one.sh @@ -32,13 +32,20 @@ REPO="khronosgroup/docker-images" if [ "$OP" == "push" ]; then docker push "$REPO:$DOCKERFILE" docker push "$REPO:$DOCKERFILE.$VERSION" + + # Show how to refer to it. + # This digest is only created by pushing to a v2 registry, + # so we can't do this reliably except in the "push" base + HASH=$(docker inspect --format='{{index .RepoDigests 0}}' "$REPO:$DOCKERFILE.$VERSION" | sed -E -n "s/.*(sha256:.*)/\1/p") + echo + echo "** To refer to this image precisely, use:" + echo " $REPO:$DOCKERFILE.$VERSION@$HASH" + else + echo + echo "** Not pushing, so no SHA256 manifest available. Until you push this image, refer to it as:" + echo " $REPO:$DOCKERFILE.$VERSION" fi - # Show how to refer to it. - HASH=$(docker inspect --format='{{index .RepoDigests 0}}' "$REPO:$DOCKERFILE.$VERSION" | sed -E -n "s/.*(sha256:.*)/\1/p") - echo - echo "** To refer to this image precisely, use:" - echo " $REPO:$DOCKERFILE.$VERSION@$HASH" [ -n "$CI" ] && echo "::endgroup::" ) diff --git a/install-android-sdk.sh b/install-android-sdk.sh index 7451c15..33e861d 100755 --- a/install-android-sdk.sh +++ b/install-android-sdk.sh @@ -1,20 +1,21 @@ #!/usr/bin/env bash -# Copyright 2022-2023, Collabora, Ltd. and the Monado contributors +# Copyright 2022-2024, Collabora, Ltd. and the Monado contributors # # SPDX-License-Identifier: BSL-1.0 # Partially inspired by https://about.gitlab.com/blog/2018/10/24/setting-up-gitlab-ci-for-android-projects/ -# and based on https://gitlab.freedesktop.org/monado/monado/-/blob/9ad98815bbc291f96c092b7aad2943ad567d65b4/.gitlab-ci/install-android-sdk.sh +# and based on https://gitlab.freedesktop.org/monado/monado/-/blob/main/.gitlab-ci/install-android-sdk.sh set -eo pipefail # These normally come from the environment but we have defaults -ANDROID_CLI_TOOLS=${ANDROID_CLI_TOOLS:-9477386} -ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-32} -ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-32.0.0} -ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-25.2.9519653} +ANDROID_CLI_TOOLS=${ANDROID_CLI_TOOLS:-10406996} +ANDROID_COMPILE_SDK=${ANDROID_COMPILE_SDK:-33} +ANDROID_BUILD_TOOLS=${ANDROID_BUILD_TOOLS:-34.0.0} +ANDROID_NDK_VERSION=${ANDROID_NDK_VERSION:-23.2.8568313} ANDROID_CMAKE_VERSION=${ANDROID_CMAKE_VERSION:-3.22.1} ANDROID_SDK_ROOT=${ANDROID_SDK_ROOT:-/opt/android-sdk} +# Bootstrap by getting the commandline tools. mkdir -p "$ANDROID_SDK_ROOT" FN=commandlinetools-linux-${ANDROID_CLI_TOOLS}_latest.zip wget https://dl.google.com/android/repository/$FN @@ -25,23 +26,19 @@ mv "$ANDROID_SDK_ROOT/extract/" "$ANDROID_SDK_ROOT/cmdline-tools/" SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager -set +o pipefail -yes | $SDKMANAGER --licenses -set -o pipefail - echo "Installing the Android compile SDK platform android-${ANDROID_COMPILE_SDK}" echo y | $SDKMANAGER "platforms;android-${ANDROID_COMPILE_SDK}" >> /dev/null echo "Installing the latest Android platform tools" echo y | $SDKMANAGER "platform-tools" >> /dev/null +echo "Installing the Android build tools ${ANDROID_BUILD_TOOLS}" +echo y | $SDKMANAGER "build-tools;${ANDROID_BUILD_TOOLS}" >> /dev/null + echo "Installing the Android NDK ${ANDROID_NDK_VERSION}" echo y | $SDKMANAGER "ndk;${ANDROID_NDK_VERSION}" >> /dev/null echo "Installing CMake ${ANDROID_CMAKE_VERSION}" echo y | $SDKMANAGER "cmake;${ANDROID_CMAKE_VERSION}" >> /dev/null -echo "Installing the Android build tools ${ANDROID_BUILD_TOOLS}" -echo y | $SDKMANAGER "build-tools;${ANDROID_BUILD_TOOLS}" >> /dev/null - rm -rf "${ANDROID_SDK_ROOT}/.temp" "${ANDROID_SDK_ROOT}/.knownPackages" diff --git a/openxr-android.Dockerfile b/openxr-android.Dockerfile index 8b72bc6..9742b2c 100644 --- a/openxr-android.Dockerfile +++ b/openxr-android.Dockerfile @@ -29,7 +29,8 @@ RUN env DEBIAN_FRONTEND=noninteractive apt-get update -qq && \ unzip \ wget \ zip \ - && apt-get clean + && apt-get clean && \ + rm -rf /var/lib/apt/lists/* # Set up user and group 1000:1000 for most common usage case RUN addgroup --gid 1000 --quiet openxr @@ -37,25 +38,23 @@ RUN useradd --shell /bin/bash --create-home --no-log-init --uid 1000 --gid 1000 ### Android SDK components -# This must match android.compileSdk in all Android build.gradle files -ENV ANDROID_COMPILE_SDK=29 +# # This must match android.compileSdk in all Android build.gradle files +# ENV ANDROID_COMPILE_SDK=33 -# This must match android.buildToolsVersion in all Android build.gradle files -ENV ANDROID_BUILD_TOOLS=30.0.3 +# # This must match android.buildToolsVersion in all Android build.gradle files +# ENV ANDROID_BUILD_TOOLS=34.0.0 -# look up on https://developer.android.com/studio/index.html#downloads when updating other versions -ENV ANDROID_CLI_TOOLS=9477386 +# # look up on https://developer.android.com/studio/index.html#downloads when updating other versions +# ENV ANDROID_CLI_TOOLS=10406996 -ENV ANDROID_NDK_VERSION=21.4.7075529 +ENV ANDROID_NDK_VERSION=23.2.8568313 ENV ANDROID_SDK_ROOT=/opt/android-sdk COPY install-android-sdk.sh /install-android-sdk.sh RUN /install-android-sdk.sh -### Android NDK - -ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/${ANDROID_NDK_VERSION} +ENV ANDROID_NDK_HOME=${ANDROID_SDK_ROOT}/ndk/${ANDROID_NDK_VERSION} # Switch to non-privileged user USER openxr