Skip to content

Commit

Permalink
Build(perf): reuse existing ndk if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias-Boulay committed Apr 16, 2024
1 parent 2b3eda7 commit a0db676
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 24 deletions.
13 changes: 12 additions & 1 deletion Dockerfile_port
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,18 @@ RUN apt-get install -y \
# JDK 17
RUN apt-get install -y openjdk-17-jdk


WORKDIR /home


# NDK install
ENV NDK_VERSION r25c
ENV ANDROID_NDK_HOME /home/android-ndk-$NDK_VERSION
RUN \
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip" \
&& unzip -q android-ndk-$NDK_VERSION-linux-x86_64.zip \
&& rm android-ndk-$NDK_VERSION-linux-x86_64.zip




COPY . .
11 changes: 8 additions & 3 deletions ci_build_global.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ set -e
export JDK_DEBUG_LEVEL=release

if [[ "$BUILD_IOS" != "1" ]]; then
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip"
./extractndk.sh
./maketoolchain.sh
if [[ -d "$ANDROID_NDK_HOME" ]]; then
echo "NDK already exists: $ANDROID_NDK_HOME"
else
echo "Downloading NDK"
wget -nc -nv -O android-ndk-$NDK_VERSION-linux-x86_64.zip "https://dl.google.com/android/repository/android-ndk-$NDK_VERSION-linux.zip"
unzip -q android-ndk-$NDK_VERSION-linux-x86_64.zip
fi
cp devkit.info.${TARGET_SHORT} ${TOOLCHAIN}
else
chmod +x ios-arm64-clang
chmod +x ios-arm64-clang++
Expand Down
2 changes: 0 additions & 2 deletions extractndk.sh

This file was deleted.

12 changes: 0 additions & 12 deletions maketoolchain.sh

This file was deleted.

14 changes: 8 additions & 6 deletions setdevkitpath.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ if [[ "$BUILD_IOS" == "1" ]]; then
else

export JVM_PLATFORM=linux
# Set NDK
export API=21
export NDK=$PWD/android-ndk-$NDK_VERSION
export ANDROID_NDK_ROOT=$NDK
#export TOOLCHAIN=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64

# Runners usually ship with a recent NDK already
if [[ -z "$ANDROID_NDK_HOME" ]]
then
export ANDROID_NDK_HOME=$PWD/android-ndk-$NDK_VERSION
fi

export TOOLCHAIN=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64

export ANDROID_INCLUDE=$TOOLCHAIN/sysroot/usr/include


# If I'm right it should only need the dummy libs
export CPPFLAGS="-I$ANDROID_INCLUDE -I$ANDROID_INCLUDE/$TARGET" # -I/usr/include -I/usr/lib
#export LDFLAGS="-L$NDK/platforms/android-$API/arch-$TARGET_SHORT/usr/lib"
export CPPFLAGS=""
export LDFLAGS=""

Expand Down

0 comments on commit a0db676

Please sign in to comment.