summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorAnton Obzhirov <a.obzhirov@samsung.com>2020-03-24 09:59:15 +0000
committerRichard Huang <r.huang@samsung.com>2020-03-27 16:18:11 +0000
commite29950484013995d7608de007bd6eb4d82d61cd6 (patch)
tree459d10814feb8872a22740aceaea8bfc5565a31d /build
parenta0cd517c9ade387b02015082d58ce8c1558caa77 (diff)
downloaddali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.tar.gz
dali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.tar.bz2
dali-demo-e29950484013995d7608de007bd6eb4d82d61cd6.zip
Add Android setenv for debugging with Android Studio.
Change-Id: I408e6c378005398e37df55bdaf2c3cd320830165
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/build.sh4
-rwxr-xr-xbuild/android/setenv35
2 files changed, 39 insertions, 0 deletions
diff --git a/build/android/build.sh b/build/android/build.sh
index 6e0bf9f9..09fa1700 100755
--- a/build/android/build.sh
+++ b/build/android/build.sh
@@ -43,6 +43,10 @@ fi
if [ ! -d "$ANDROID_NDK" ]; then
if [ -d "$ANDROID_SDK" ]; then
NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//')
+ # Some sdk folder structures have extra <version> dir for ndk folders.
+ if [ ! -d "$NDK_DIR" ]; then
+ NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//')
+ fi
if [ -d "$NDK_DIR" ]; then
export ANDROID_NDK=$NDK_DIR
fi
diff --git a/build/android/setenv b/build/android/setenv
new file mode 100755
index 00000000..c85e935e
--- /dev/null
+++ b/build/android/setenv
@@ -0,0 +1,35 @@
+[ -z $ROOT_DIR ] && ROOT_DIR=$HOME
+echo "Using ROOT_DIR=\"$ROOT_DIR\""
+
+[ -z $DALI_DIR ] && DALI_DIR=$(cd ../../../;pwd)
+echo "Using DALI_DIR=\"$DALI_DIR\""
+export DALI_DIR=$DALI_DIR
+
+[ -z $DALI_ENV_DIR ] && DALI_ENV_DIR=$DALI_DIR/dali-env/android
+echo "Using DALI_ENV_DIR=\"$DALI_ENV_DIR\""
+export DALI_ENV_DIR=$DALI_ENV_DIR
+
+[ -z $TARGET ] && export TARGET=armeabi-v7a
+echo "Using TARGET=\"$TARGET\""
+
+if [ ! -d "$ANDROID_SDK" ]; then
+# try default path
+ if [ -d "$ROOT_DIR/Android/Sdk" ]; then
+ export ANDROID_SDK=$ROOT_DIR/Android/Sdk
+ fi
+fi
+echo "Using ANDROID_SDK=\"$ANDROID_SDK\""
+
+if [ ! -d "$ANDROID_NDK" ]; then
+ if [ -d "$ANDROID_SDK" ]; then
+ NDK_DIR=$(find $ANDROID_SDK -maxdepth 2 -name ndk-build | sed 's/\/ndk-build//')
+ # Some sdk folder structures have extra <version> dir for ndk folders.
+ if [ ! -d "$NDK_DIR" ]; then
+ NDK_DIR=$(find $ANDROID_SDK -maxdepth 3 -name ndk-build | sed 's/\/ndk-build//')
+ fi
+ if [ -d "$NDK_DIR" ]; then
+ export ANDROID_NDK=$NDK_DIR
+ fi
+ fi
+fi
+echo "Using ANDROID_NDK=\"$ANDROID_NDK\""