Skip to content

Commit 19ec581

Browse files
committed
make: print debug ndk info if changed
1 parent 9a067d4 commit 19ec581

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

make-aar

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,30 @@ CLASSDBG="${CLASSDBG:-debug}"
2626
# artifact bytecode sources
2727
SOURCES="${SOURCES:-build/intra/tun2socks-sources.jar}"
2828
# android sdk/ndk versions
29-
NDKVER="${NDKVER:-28.1.13356709}"
30-
SDKVER="${SDKVER:-35}"
29+
NDKVER="${NDKVER:-0}"
30+
SDKVER="${SDKVER:-36}"
3131

3232
ARG1="${1:-go}"
3333
ARG2="${2:-debug}"
3434

35-
ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${NDKVER}"
36-
ANDROID_NDK_ROOT="${ANDROID_NDK_HOME}"
3735

3836
# debug
3937
printenv
38+
4039
ls -ltr $ANDROID_HOME/**
4140
head $ANDROID_HOME/ndk-bundle/source.properties || true
42-
ls -ltr $ANDROID_NDK_HOME
43-
head $ANDROID_NDK_HOME/source.properties || true
41+
42+
# gomobile picks up the latest ndk by walking the ndk dir
43+
# in $ANDROID_HOME (on gh-actions: /usr/local/lib/android/sdk/ndk)
44+
# if NDKVER is set, override gomobile's behaviour by force setting
45+
# $ANDROID_NDK_HOME & $ANDROID_NDK_ROOT to the requested NDK version.
46+
if [ "$NDKVER" != "0" ]; then
47+
ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${NDKVER}"
48+
ANDROID_NDK_ROOT="${ANDROID_NDK_HOME}"
49+
# ls will fail if NDKVER is missing, which is what we want!
50+
ls -ltr $ANDROID_NDK_HOME
51+
head $ANDROID_NDK_HOME/source.properties || true
52+
fi
4453

4554
if [ "$ARG1" = "go" ]; then
4655
# download from go.dev/dl

0 commit comments

Comments
 (0)