1#!/usr/bin/env bash 2 3set -xeo pipefail 4 5ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6ARTIFACTS_DIR="$ROOT_DIR/artifacts" 7TEMP_DIR="/tmp/android-shell-app" 8 9mkdir -p $ARTIFACTS_DIR 10rm -rf $TEMP_DIR 11mkdir -p $TEMP_DIR 12 13# we use the root android project as a shell app template 14ln -s ${ROOT_DIR}/android $TEMP_DIR/android 15# We wouldn't want to use any versioned ABI in a standalone app 16# and it makes the shell app smaller. 17rm -rf $TEMP_DIR/android/versioned-abis 18 19# root package.json defines a dependency on react-native-unimodules, 20# which we require when building the shell app 21ln -s ${ROOT_DIR}/package.json $TEMP_DIR/package.json 22 23# packages are used by the optional-modules-linking-code in XDL 24# see xdl/AndroidShellApp.js 25ln -s ${ROOT_DIR}/packages $TEMP_DIR/packages 26 27# generate dynamic macros (we can do it here, as the contents are already `ln -s`-ed) 28et android-generate-dynamic-macros --configuration release 29 30# build the artifact 31cd $TEMP_DIR; tar -czhf $ARTIFACTS_DIR/android-shell-builder.tar.gz . 32rm -rf $TEMP_DIR 33