[Android] Add simple package script
authorJihoon Lee <jhoon.it.lee@samsung.com>
Fri, 22 Oct 2021 10:11:07 +0000 (19:11 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 26 Oct 2021 00:04:49 +0000 (09:04 +0900)
This patch adds android simple package script to make tar.gz

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
.gitignore
tools/package_android.sh [new file with mode: 0755]

index 5678f6f..bbd7994 100644 (file)
@@ -55,3 +55,6 @@ __pycache__/
 
 # flatbuffer compiled header
 *_generated.h
+
+# android build
+nntrainer_for_android.tar.gz
diff --git a/tools/package_android.sh b/tools/package_android.sh
new file mode 100755 (executable)
index 0000000..fbb0764
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -e
+
+TARGET=$1
+[ -z $1 ] && TARGET=$(pwd)
+echo $TARGET
+
+if [ ! -d $TARGET ]; then
+  echo $TARGET is not a directory. please put project root of nntrainer
+  exit 1
+fi
+
+pushd $TARGET
+
+if [ !d builddir ]; then
+  meson builddir -Dplatform=android
+else
+  echo "warning: $TARGET/builddir has already been taken, this script tries to reconfigure and try building"
+  pushd builddir
+    meson configure -Dplatform=android
+    meson --wipe
+  popd
+fi
+
+pushd builddir
+ninja install
+
+tar -czvf $TARGET/nntrainer_for_android.tar.gz --directory=android_build_result .
+
+popd
+popd
+