Welcome to mirror list, hosted at ThFree Co, Russian Federation.

native_build.sh « UnitTests « android - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5bfcf130d05fbcbde7ba009774fb1aae65234927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash

MY_PATH=$(dirname "$0")                 # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`"  # absolutized and normalized

source "$MY_PATH/tests_list.sh"

declare -r NDK_ABI=armeabi-v7a-hard

declare -r PROP_DEBUG_NDK_FLAGS="-j8 V=1 NDK_DEBUG=1 DEBUG=1 APP_ABI=$NDK_ABI"
declare -r PROP_RELEASE_NDK_FLAGS="-j8 V=1 NDK_DEBUG=0 PRODUCTION=1 APP_ABI=$NDK_ABI"

Usage() {
  echo "Usage: $0 <debug|release|production>" 1>&2
  exit 1
}

NdkBuild() {
  if [ "$1" = "debug" ]; then
    NDK_PARAMS="--directory=$2 ${PROP_DEBUG_NDK_FLAGS}"
  else
    NDK_PARAMS="--directory=$2 ${PROP_RELEASE_NDK_FLAGS}"
  fi
  echo "ndk-build $NDK_PARAMS"
  ndk-build $NDK_PARAMS
}

if [ $# != 1 ]; then
  Usage
fi

if [ "$1" != "debug" && "$1" != "release" && "$1" != "production" ]; then
  Usage
fi

echo "Building omim/andoid..."
if [ "$1" = "debug" ]; then
  bash $MY_PATH/../../tools/autobuild/android.sh debug $NDK_ABI
else
  bash $MY_PATH/../../tools/autobuild/android.sh production $NDK_ABI
fi

for test in "${TESTS_LIST[@]}"; do
  echo "Building test $test"
  NdkBuild $1 ${test}
done

echo "Copying so-files with tests to the libs directory: "
TMP_LIB_DIR=$MY_PATH/libs/tmp/$NDK_ABI/
echo $TMP_LIB_DIR
mkdir -p $TMP_LIB_DIR
for test in "${TESTS_LIST[@]}"; do
  echo "Copying so-file for test: $test"
  cp -r $test/libs/*/*.so $TMP_LIB_DIR
done

echo "Building main so file for the native activity... "
NdkBuild $1 .