diff options
author | Gil <mcg@google.com> | 2018-03-07 08:44:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-07 08:44:54 -0800 |
commit | 5930ad2feebc6628cbaec89b8f6a6146ed6afe5d (patch) | |
tree | 9f3c4efa8ad9dbcf9041302e9654719a417035cd /Firestore/test.sh | |
parent | 8ef0f1490a72fd700f609dc9971ec16868d6747b (diff) |
Factor out a universal build script (#884)
* Add a universal build script
* Rewrite test.sh in terms of universal build
Diffstat (limited to 'Firestore/test.sh')
-rwxr-xr-x | Firestore/test.sh | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/Firestore/test.sh b/Firestore/test.sh index 7be70d0..50c6c7c 100755 --- a/Firestore/test.sh +++ b/Firestore/test.sh @@ -13,54 +13,8 @@ set -euo pipefail -FIRESTORE_DIR=$(dirname "${BASH_SOURCE[0]}") +firestore_dir=$(dirname "${BASH_SOURCE[0]}") +scripts_dir="$firestore_dir/../scripts" -test_iOS() { - xcodebuild \ - -workspace "$FIRESTORE_DIR/Example/Firestore.xcworkspace" \ - -scheme Firestore_Tests \ - -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 7' \ - build \ - test \ - ONLY_ACTIVE_ARCH=YES \ - CODE_SIGNING_REQUIRED=NO \ - | xcpretty - - xcodebuild \ - -workspace "$FIRESTORE_DIR/Example/Firestore.xcworkspace" \ - -scheme SwiftBuildTest \ - -sdk iphonesimulator \ - -destination 'platform=iOS Simulator,name=iPhone 7' \ - build \ - ONLY_ACTIVE_ARCH=YES \ - CODE_SIGNING_REQUIRED=NO \ - | xcpretty -} - -test_CMake() { - echo "cpu core: $(sysctl -n hw.ncpu)" - echo "prepare cmake build" && \ - mkdir -p build && \ - cd build && \ - cmake .. || \ - exit 1 - - echo "cmake build and test" && \ - make -j $(sysctl -n hw.ncpu) all || \ - exit 2 -} - -test_iOS; RESULT=$? -if [[ $RESULT == 65 ]]; then - echo "xcodebuild exited with 65, retrying" - sleep 5 - - test_iOS; RESULT=$? -fi - -if [ $RESULT != 0 ]; then exit $RESULT; fi - -test_CMake; RESULT=$? - -if [ $RESULT != 0 ]; then exit $RESULT; fi +$scripts_dir/build.sh Firestore iOS +$scripts_dir/build.sh Firestore macOS cmake |