diff --git a/.github/workflows/android-ci-pull.yml b/.github/workflows/android-ci-pull.yml index d32ec7d00..8cd743ba9 100644 --- a/.github/workflows/android-ci-pull.yml +++ b/.github/workflows/android-ci-pull.yml @@ -28,14 +28,11 @@ concurrency: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: working-directory: platform/android - container: - image: ghcr.io/maplibre/android-ndk-r21b env: - LIBSYSCONFCPUS: 8 JOBS: 8 BUILDTYPE: Debug IS_LOCAL_DEVELOPMENT: false @@ -47,14 +44,6 @@ jobs: submodules: recursive fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '11' - - - name: Setup Android SDK for accepting tool licenses - uses: android-actions/setup-android@v2 - - name: Cache node modules uses: actions/cache@v3 env: @@ -71,6 +60,9 @@ jobs: run: npm install --ignore-scripts working-directory: platform/android + - name: Install ccache + run: sudo apt-get install -y ccache + - name: Prepare ccache run: ccache --clear diff --git a/.github/workflows/android-ci.yml b/.github/workflows/android-ci.yml index 87a70c6a6..88d3a1516 100644 --- a/.github/workflows/android-ci.yml +++ b/.github/workflows/android-ci.yml @@ -25,17 +25,11 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: working-directory: platform/android - container: - image: ghcr.io/maplibre/android-ndk-r21b - credentials: - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} env: - LIBSYSCONFCPUS: 8 JOBS: 8 BUILDTYPE: Debug IS_LOCAL_DEVELOPMENT: false @@ -47,14 +41,6 @@ jobs: submodules: recursive fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: '11' - - - name: Setup Android SDK for accepting tool licenses - uses: android-actions/setup-android@v2 - - name: Cache node modules uses: actions/cache@v3 env: @@ -70,6 +56,9 @@ jobs: - name: npm install run: npm install --ignore-scripts + - name: Install ccache + run: sudo apt-get install -y ccache + - name: Prepare ccache run: ccache --clear diff --git a/.github/workflows/android-docker-base.yml b/.github/workflows/android-docker-base.yml deleted file mode 100644 index a82292184..000000000 --- a/.github/workflows/android-docker-base.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: android-base-docker-image -on: - workflow_dispatch -jobs: - push_to_registry: - name: Docker image android-base - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to ghcr.io - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - - name: Build and push android-base image - uses: docker/build-push-action@v3 - with: - file: ./platform/android/docker/android-base - context: ./platform/android/docker - tags: ghcr.io/maplibre/android-base:latest - push: true \ No newline at end of file diff --git a/.github/workflows/android-docker-ndk-r21b.yml b/.github/workflows/android-docker-ndk-r21b.yml deleted file mode 100644 index 3a1eb912c..000000000 --- a/.github/workflows/android-docker-ndk-r21b.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: android-ndk-r21b-docker-image -on: - workflow_dispatch -jobs: - push_to_registry: - name: Docker image android-ndk-r21b - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to ghcr.io - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.CR_PAT }} - - - name: Build and push android-ndk-r21b image - uses: docker/build-push-action@v3 - with: - file: ./platform/android/docker/android-ndk-r21b - context: ./platform/android/docker - tags: ghcr.io/maplibre/android-ndk-r21b:latest - push: true \ No newline at end of file diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index 8d7005c2e..d84418d85 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -5,14 +5,11 @@ on: jobs: build: - runs-on: [self-hosted, Linux] + runs-on: ubuntu-22.04 defaults: run: working-directory: platform/android - container: - image: ghcr.io/maplibre/android-ndk-r21b env: - LIBSYSCONFCPUS: 8 JOBS: 8 BUILDTYPE: Release IS_LOCAL_DEVELOPMENT: false @@ -44,6 +41,9 @@ jobs: run: npm install --ignore-scripts working-directory: platform/android + - name: Install ccache + run: sudo apt-get install -y ccache + - name: Prepare ccache run: ccache --clear diff --git a/benchmark/android/app/build.gradle b/benchmark/android/app/build.gradle index 7d5286d50..d7af08c3e 100644 --- a/benchmark/android/app/build.gradle +++ b/benchmark/android/app/build.gradle @@ -1,7 +1,9 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 33 + compileSdkVersion androidVersions.compileSdkVersion + ndkVersion androidSdkVersions.ndkVersion + buildToolsVersion androidSdkVersions.buildToolsVersion defaultConfig { applicationId = 'com.mapbox.mapboxsdk.maps.benchmark_runner' @@ -32,7 +34,7 @@ android { } externalNativeBuild { cmake { - version '3.10.2' + version androidSdkVersions.cmakeVersion path '../../../CMakeLists.txt' } } diff --git a/platform/android/MapboxGLAndroidSDK/build.gradle b/platform/android/MapboxGLAndroidSDK/build.gradle index b3a9e2ffe..674a5a0f0 100644 --- a/platform/android/MapboxGLAndroidSDK/build.gradle +++ b/platform/android/MapboxGLAndroidSDK/build.gradle @@ -34,6 +34,7 @@ dependencies { android { compileSdkVersion androidVersions.compileSdkVersion + buildToolsVersion androidSdkVersions.buildToolsVersion defaultConfig { minSdkVersion androidVersions.minSdkVersion diff --git a/platform/android/docker/README.md b/platform/android/docker/README.md deleted file mode 100644 index 8d220e2e4..000000000 --- a/platform/android/docker/README.md +++ /dev/null @@ -1,5 +0,0 @@ - -``` -docker build -t maplibre/android-base -f android-base . -docker build -t maplibre/android-ndk-r21b -f android-ndk-r21b . -``` \ No newline at end of file diff --git a/platform/android/docker/android-base b/platform/android/docker/android-base deleted file mode 100644 index c136ee328..000000000 --- a/platform/android/docker/android-base +++ /dev/null @@ -1,57 +0,0 @@ -FROM ubuntu:xenial-20181005 -ENV DEBIAN_FRONTEND="noninteractive" - -# Add base filesystems -ADD filesystem/libsysconfcpus.tar.gz \ - filesystem/apt-google-cloud-sdk.tar.gz \ - / - -# libsysconfcpus.so can be used to alter the number of CPUs reported by the system -ENV LD_PRELOAD=/usr/lib/libsysconfcpus.so - -# Add apt keys -RUN set -eu \ - && (find /tmp/*.gpg | xargs -n1 apt-key add) \ - && rm /tmp/*.gpg - -# Install base packages -RUN set -eu \ - && apt-get update \ - && apt-get -y install software-properties-common \ - && apt-get update \ - && add-apt-repository -y ppa:git-core/ppa \ - && apt-get update \ - && apt-get -y install git curl make python3 python3-pip zip unzip ccache openjdk-11-jdk-headless apt-transport-https \ - && update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \ - && rm -rf /var/lib/apt/lists/* - -# Install CLI tools for CI scripting -RUN set -eu \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 \ - && apt-add-repository https://cli.github.com/packages \ - && apt-get update \ - && apt-get -y install jq gh \ - && rm -rf /var/lib/apt/lists/* - -# Install Google Cloud SDK -RUN set -eu \ - && apt-get update \ - && apt-get -y install google-cloud-sdk \ - && rm -rf /var/lib/apt/lists/* - -# Install awscli -RUN set -eu \ - && pip3 install awscli - -# Install Node.js -# Check https://nodejs.org/en/download/releases/ for releases -ENV NVM_DIR="/root/.nvm" \ - PATH="/root/.nvm/versions/node/v10.13.0/bin:$PATH" -RUN set -e \ - && git -c advice.detachedHead=false clone https://github.com/creationix/nvm.git -b v0.33.11 --depth=1 "$NVM_DIR" \ - && . "$NVM_DIR/nvm.sh" \ - && nvm install v10.13.0 - -ENV ANDROID_NDK_HOME=/android/sdk/ndk-bundle \ - ANDROID_HOME=/android/sdk \ - GRADLE_OPTS=-Dorg.gradle.daemon=false \ No newline at end of file diff --git a/platform/android/docker/android-ndk-r21b b/platform/android/docker/android-ndk-r21b deleted file mode 100644 index 5226f1698..000000000 --- a/platform/android/docker/android-ndk-r21b +++ /dev/null @@ -1,41 +0,0 @@ -FROM ghcr.io/maplibre/android-base - -WORKDIR /android/sdk - -# Install Android SDK -# Use most recent version from https://developer.android.com/studio/index.html#command-tools -# and update the checksum. -RUN set -eu \ - && curl -L --retry 3 https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip -o tools.zip \ - && (echo "f10f9d5bca53cc27e2d210be2cbc7c0f1ee906ad9b868748d74d62e10f2c8275 tools.zip" | sha256sum -c) \ - && unzip -q tools.zip && rm tools.zip - -# Install Android NDK -# Use desired version from https://developer.android.com/ndk/downloads/index.html -# and update the checksum. -RUN set -eu \ - && curl -L --retry 3 https://dl.google.com/android/repository/android-ndk-r21-linux-x86_64.zip -o ndk.zip \ - && (echo "afc9c0b9faad222898ac8168c78ad4ccac8a1b5c ndk.zip" | sha1sum -c) \ - && unzip -q ndk.zip && rm ndk.zip && mv android-ndk-r* ndk-bundle - -# Install dependencies and build tools - -RUN set -eu \ - && mkdir -p "${ANDROID_HOME}/licenses" \ - && echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > "${ANDROID_HOME}/licenses/android-sdk-license" \ - && tools/bin/sdkmanager \ - "--sdk_root=${ANDROID_HOME}" \ - "platform-tools" \ - "platforms;android-29" \ - "build-tools;29.0.2" \ - "build-tools;29.0.3" \ - "platforms;android-28" \ - "build-tools;28.0.3" \ - "extras;android;m2repository" \ - "patcher;v4" \ - "extras;google;m2repository" \ - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \ - "cmake;3.10.2.4988404" \ - && rm -rf "${ANDROID_HOME}/licenses" - -WORKDIR /src \ No newline at end of file diff --git a/platform/android/docker/filesystem/apt-google-cloud-sdk.tar.gz b/platform/android/docker/filesystem/apt-google-cloud-sdk.tar.gz deleted file mode 100644 index 7d4d9b821..000000000 Binary files a/platform/android/docker/filesystem/apt-google-cloud-sdk.tar.gz and /dev/null differ diff --git a/platform/android/docker/filesystem/apt-llvm.tar.gz b/platform/android/docker/filesystem/apt-llvm.tar.gz deleted file mode 100644 index 4e2ddc05e..000000000 Binary files a/platform/android/docker/filesystem/apt-llvm.tar.gz and /dev/null differ diff --git a/platform/android/docker/filesystem/apt-toolchain.tar.gz b/platform/android/docker/filesystem/apt-toolchain.tar.gz deleted file mode 100644 index 90eb302a3..000000000 Binary files a/platform/android/docker/filesystem/apt-toolchain.tar.gz and /dev/null differ diff --git a/platform/android/docker/filesystem/etc/apt/sources.list.d/google-cloud-sdk.list b/platform/android/docker/filesystem/etc/apt/sources.list.d/google-cloud-sdk.list deleted file mode 100644 index 687dba5ed..000000000 --- a/platform/android/docker/filesystem/etc/apt/sources.list.d/google-cloud-sdk.list +++ /dev/null @@ -1 +0,0 @@ -deb http://packages.cloud.google.com/apt cloud-sdk-xenial main diff --git a/platform/android/docker/filesystem/etc/apt/sources.list.d/llvm.list b/platform/android/docker/filesystem/etc/apt/sources.list.d/llvm.list deleted file mode 100644 index 906c29eb1..000000000 --- a/platform/android/docker/filesystem/etc/apt/sources.list.d/llvm.list +++ /dev/null @@ -1,2 +0,0 @@ -deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main -deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main diff --git a/platform/android/docker/filesystem/etc/apt/sources.list.d/toolchain.list b/platform/android/docker/filesystem/etc/apt/sources.list.d/toolchain.list deleted file mode 100644 index 76d1868cc..000000000 --- a/platform/android/docker/filesystem/etc/apt/sources.list.d/toolchain.list +++ /dev/null @@ -1,2 +0,0 @@ -deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main -deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main diff --git a/platform/android/docker/filesystem/libsysconfcpus.tar.gz b/platform/android/docker/filesystem/libsysconfcpus.tar.gz deleted file mode 100644 index bc066ff2c..000000000 Binary files a/platform/android/docker/filesystem/libsysconfcpus.tar.gz and /dev/null differ diff --git a/platform/android/docker/filesystem/tmp/google-cloud-sdk.gpg b/platform/android/docker/filesystem/tmp/google-cloud-sdk.gpg deleted file mode 100644 index 37fc65d93..000000000 Binary files a/platform/android/docker/filesystem/tmp/google-cloud-sdk.gpg and /dev/null differ diff --git a/platform/android/docker/filesystem/tmp/llvm.gpg b/platform/android/docker/filesystem/tmp/llvm.gpg deleted file mode 100644 index 1af748690..000000000 Binary files a/platform/android/docker/filesystem/tmp/llvm.gpg and /dev/null differ diff --git a/platform/android/docker/filesystem/tmp/toolchain.gpg b/platform/android/docker/filesystem/tmp/toolchain.gpg deleted file mode 100644 index 8771a79ac..000000000 Binary files a/platform/android/docker/filesystem/tmp/toolchain.gpg and /dev/null differ diff --git a/platform/android/gradle/dependencies.gradle b/platform/android/gradle/dependencies.gradle index e8a55cb41..d82f60d34 100644 --- a/platform/android/gradle/dependencies.gradle +++ b/platform/android/gradle/dependencies.gradle @@ -6,6 +6,12 @@ ext { compileSdkVersion: 33, ] + androidSdkVersions = [ + buildToolsVersion: '31.0.0', + ndkVersion : '25.1.8937393', + cmakeVersion : '3.18.1+', + ] + versions = [ mapLibreServices: '5.9.0', mapboxCore : '2.0.1', diff --git a/platform/android/gradle/native-build.gradle b/platform/android/gradle/native-build.gradle index 1c3414579..5c66f466f 100644 --- a/platform/android/gradle/native-build.gradle +++ b/platform/android/gradle/native-build.gradle @@ -1,5 +1,8 @@ ext.nativeBuild = { nativeTargets -> android { + ndkVersion androidSdkVersions.ndkVersion + buildToolsVersion androidSdkVersions.buildToolsVersion + defaultPublishConfig project.hasProperty("mapbox.buildtype") ? project.getProperty("mapbox.buildtype") : "debug" // We sometimes want to invoke Gradle without building a native dependency, e.g. when we just want @@ -22,7 +25,7 @@ ext.nativeBuild = { nativeTargets -> externalNativeBuild { cmake { path "../MapboxGLAndroidSDK/src/cpp/CMakeLists.txt" - version "3.10.2" + version androidSdkVersions.cmakeVersion } } }