mirror of
https://github.com/AngelAuraMC/angelauramc-openjdk-build.git
synced 2025-09-10 04:37:37 -04:00
Build(perf): reuse existing ndk if available
This commit is contained in:
parent
2b3eda724c
commit
a0db676d65
@ -32,7 +32,18 @@ RUN apt-get install -y \
|
|||||||
# JDK 17
|
# JDK 17
|
||||||
RUN apt-get install -y openjdk-17-jdk
|
RUN apt-get install -y openjdk-17-jdk
|
||||||
|
|
||||||
|
|
||||||
WORKDIR /home
|
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 . .
|
COPY . .
|
@ -5,9 +5,14 @@ set -e
|
|||||||
export JDK_DEBUG_LEVEL=release
|
export JDK_DEBUG_LEVEL=release
|
||||||
|
|
||||||
if [[ "$BUILD_IOS" != "1" ]]; then
|
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"
|
if [[ -d "$ANDROID_NDK_HOME" ]]; then
|
||||||
./extractndk.sh
|
echo "NDK already exists: $ANDROID_NDK_HOME"
|
||||||
./maketoolchain.sh
|
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
|
else
|
||||||
chmod +x ios-arm64-clang
|
chmod +x ios-arm64-clang
|
||||||
chmod +x ios-arm64-clang++
|
chmod +x ios-arm64-clang++
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
unzip -q android-ndk-$NDK_VERSION-linux-x86_64.zip
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
. setdevkitpath.sh
|
|
||||||
|
|
||||||
# No need since all toolchains are standalone
|
|
||||||
# $NDK/build/tools/make_standalone_toolchain.py \
|
|
||||||
# --arch=${TARGET_SHORT} \
|
|
||||||
# --api=21 \
|
|
||||||
# --install-dir=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
|
|
||||||
|
|
||||||
cp devkit.info.${TARGET_SHORT} ${TOOLCHAIN}
|
|
@ -44,19 +44,21 @@ if [[ "$BUILD_IOS" == "1" ]]; then
|
|||||||
else
|
else
|
||||||
|
|
||||||
export JVM_PLATFORM=linux
|
export JVM_PLATFORM=linux
|
||||||
# Set NDK
|
|
||||||
export API=21
|
export API=21
|
||||||
export NDK=$PWD/android-ndk-$NDK_VERSION
|
|
||||||
export ANDROID_NDK_ROOT=$NDK
|
# Runners usually ship with a recent NDK already
|
||||||
#export TOOLCHAIN=$NDK/generated-toolchains/android-${TARGET_SHORT}-toolchain
|
if [[ -z "$ANDROID_NDK_HOME" ]]
|
||||||
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64
|
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
|
export ANDROID_INCLUDE=$TOOLCHAIN/sysroot/usr/include
|
||||||
|
|
||||||
|
|
||||||
# If I'm right it should only need the dummy libs
|
# 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 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 CPPFLAGS=""
|
||||||
export LDFLAGS=""
|
export LDFLAGS=""
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user