From a217c8bc9cba0e6dd60db53cd6653c8e21734c76 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 15 Nov 2016 12:47:43 -0800 Subject: [PATCH] Allow specifying no destination for the uiexplorer test run Summary: This is a simple change to allow not specifying xcodebuild's `-destination` flag if we just need to build the project without running the test. Reviewed By: bestander Differential Revision: D4173546 fbshipit-source-id: 0b77bb5fc01d8cb6a8c9bc765294796631839655 --- scripts/objc-test-ios.sh | 2 +- scripts/objc-test-tvos.sh | 2 +- scripts/objc-test.sh | 20 ++++++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/scripts/objc-test-ios.sh b/scripts/objc-test-ios.sh index 6677e9cb21d..f6db784d99b 100755 --- a/scripts/objc-test-ios.sh +++ b/scripts/objc-test-ios.sh @@ -9,7 +9,7 @@ cd $ROOT XCODE_PROJECT="Examples/UIExplorer/UIExplorer.xcodeproj" XCODE_SCHEME="UIExplorer" XCODE_SDK="iphonesimulator" -if [ -z "$XCODE_DESTINATION" ]; then +if [ -z ${XCODE_DESTINATION+x} ]; then XCODE_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.0" fi diff --git a/scripts/objc-test-tvos.sh b/scripts/objc-test-tvos.sh index 41c1b93d56f..039d0df9987 100755 --- a/scripts/objc-test-tvos.sh +++ b/scripts/objc-test-tvos.sh @@ -10,7 +10,7 @@ cd $ROOT XCODE_PROJECT="Examples/UIExplorer/UIExplorer.xcodeproj" XCODE_SCHEME="UIExplorer-tvOS" XCODE_SDK="appletvsimulator" -if [ -z "$XCODE_DESTINATION" ]; then +if [ -z ${XCODE_DESTINATION+x} ]; then XCODE_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p,OS=9.2" fi diff --git a/scripts/objc-test.sh b/scripts/objc-test.sh index c3fa20f5630..d9dda1a7fd2 100755 --- a/scripts/objc-test.sh +++ b/scripts/objc-test.sh @@ -34,9 +34,17 @@ fi # TODO: We use xcodebuild because xctool would stall when collecting info about # the tests before running them. Switch back when this issue with xctool has # been resolved. -xcodebuild \ - -project $XCODE_PROJECT \ - -scheme $XCODE_SCHEME \ - -sdk $XCODE_SDK \ - -destination "$XCODE_DESTINATION" \ - $XCODE_BUILD_STEPS +if [ -n "$XCODE_DESTINATION" ]; then + xcodebuild \ + -project $XCODE_PROJECT \ + -scheme $XCODE_SCHEME \ + -sdk $XCODE_SDK \ + -destination "$XCODE_DESTINATION" \ + $XCODE_BUILD_STEPS +else + xcodebuild \ + -project $XCODE_PROJECT \ + -scheme $XCODE_SCHEME \ + -sdk $XCODE_SDK \ + $XCODE_BUILD_STEPS +fi