File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,21 +26,30 @@ CLASSDBG="${CLASSDBG:-debug}"
2626# artifact bytecode sources
2727SOURCES=" ${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
3232ARG1=" ${1:- go} "
3333ARG2=" ${2:- debug} "
3434
35- ANDROID_NDK_HOME=" ${ANDROID_HOME} /ndk/${NDKVER} "
36- ANDROID_NDK_ROOT=" ${ANDROID_NDK_HOME} "
3735
3836# debug
3937printenv
38+
4039ls -ltr $ANDROID_HOME /**
4140head $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
4554if [ " $ARG1 " = " go" ]; then
4655 # download from go.dev/dl
You can’t perform that action at this time.
0 commit comments