fix android unit tests and add better macos instructions

This commit is contained in:
John Smith
2022-08-23 10:37:41 -04:00
parent e112cc4527
commit 1793dd90e8
13 changed files with 227 additions and 75 deletions

View File

@@ -6,17 +6,53 @@ if [ ! "$(uname)" == "Darwin" ]; then
exit 1
fi
# install targets
rustup target add aarch64-apple-darwin aarch64-apple-ios x86_64-apple-darwin x86_64-apple-ios wasm32-unknown-unknown
# ensure ANDROID_SDK_ROOT is defined and exists
if [ -d "$ANDROID_SDK_ROOT" ]; then
echo '[X] $ANDROID_SDK_ROOT is defined and exists'
else
echo '$ANDROID_SDK_ROOT is not defined or does not exist'
exit 1
fi
# install cargo packages
cargo install wasm-bindgen-cli
# ensure ANDROID_NDK_HOME is defined and exists
if [ -d "$ANDROID_NDK_HOME" ]; then
echo '[X] $ANDROID_NDK_HOME is defined and exists'
else
echo '$ANDROID_NDK_HOME is not defined or does not exist'
exit 1
fi
# install bitcode compatible ios toolchain
# echo Manual Step:
# echo install +ios-arm64-1.57.0 toolchain for bitcode from https://github.com/getditto/rust-bitcode/releases/latest and unzip
# echo xattr -d -r com.apple.quarantine .
# echo ./install.sh
# ensure ndk is installed
if [ -f "$ANDROID_NDK_HOME/ndk-build" ]; then
echo '[X] Android NDK is installed at the location $ANDROID_NDK_HOME'
else
echo 'Android NDK is not installed at the location $ANDROID_NDK_HOME'
exit 1
fi
# ensure cmake is installed
if [ -d "$ANDROID_SDK_ROOT/cmake" ]; then
echo '[X] Android SDK CMake is installed'
else
echo 'Android SDK CMake is not installed'
exit 1
fi
# ensure emulator is installed
if [ -d "$ANDROID_SDK_ROOT/emulator" ]; then
echo '[X] Android SDK emulator is installed'
else
echo 'Android SDK emulator is not installed'
exit 1
fi
# ensure adb is installed
if command -v adb &> /dev/null; then
echo '[X] adb is available in the path'
else
echo 'adb is not available in the path'
exit 1
fi
# ensure brew is installed
if command -v brew &> /dev/null; then
@@ -34,6 +70,34 @@ else
exit 1
fi
# ensure rustup is installed
if command -v rustup &> /dev/null; then
echo '[X] rustup is available in the path'
else
echo 'rustup is not available in the path'
exit 1
fi
# ensure cargo is installed
if command -v cargo &> /dev/null; then
echo '[X] cargo is available in the path'
else
echo 'cargo is not available in the path'
exit 1
fi
# install targets
rustup target add aarch64-apple-darwin aarch64-apple-ios x86_64-apple-darwin x86_64-apple-ios wasm32-unknown-unknown aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
# install cargo packages
cargo install wasm-bindgen-cli
# install bitcode compatible ios toolchain
# echo Manual Step:
# echo install +ios-arm64-1.57.0 toolchain for bitcode from https://github.com/getditto/rust-bitcode/releases/latest and unzip
# echo xattr -d -r com.apple.quarantine .
# echo ./install.sh
# ensure we have command line tools
xcode-select --install