1#!/usr/bin/env bash
2
3echo " ☛  Ensuring Android project is setup..."
4
5CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
6cd "${CURR_DIR}/.."
7
8if [ -d "./node_modules" ]; then
9    echo " ✅ Node modules installed"
10else
11    echo " ⚠️  Cannot find node modules for this project, installing..."
12    yarn
13fi
14
15"${CURR_DIR}/../../../bin/expotools" android-generate-dynamic-macros --configuration $1 --bare
16echo " ✅ Generete dynamic macros"
17
18if [ ! -d "android/app/src/androidTest/assets" ]; then
19  mkdir -p android/app/src/androidTest/assets
20fi
21yarn --silent ts-node --print --transpile-only -e 'function describe() {}; JSON.stringify(require("./e2e/TestSuite-test.native.js").TESTS, null, 2)' > android/app/src/androidTest/assets/TestSuite.json
22echo " ✅ Generete e2e test cases"
23