Skip to content
Browse files

Fix Xcode build path in the static lib build script for Xcode 4.3.1+ …

…or version downloaded from App Store

Summary: Previously xcodebuild could be found under the /Developer directory but it has since moved for Xcode downloaded from the App Store. If the developer has migrated from one version to another, then calling "which xcodebuild" will not work, unless they have run a script called "xcode-select switch". So for now we first check the older location, then look in the newer App Store location.

Test Plan: I tried running the build script in my folder after a recent upgrade from 4.2 to 4.3.1. Without the build script change I got an error. With the build script change, the library was generated.

Reviewers: mmarucheck, bruce, jacl

Reviewed By: jacl

CC: selekman, vijaye, jacl, gregschechte

Differential Revision: https://phabricator.fb.com/D440943

Revert Plan: OK

Task ID: 998703
  • Loading branch information...
1 parent 07626c3 commit 0fb29548e0c3db76df3d43c4151f21ca3e32c9c5 @caabernathy caabernathy committed Apr 2, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 scripts/build_facebook_ios_sdk_static_lib.sh
View
9 scripts/build_facebook_ios_sdk_static_lib.sh
@@ -19,8 +19,15 @@ die() {
}
# The Xcode bin path
-XCODEBUILD_PATH=/Developer/usr/bin
+if [ -d "/Developer/usr/bin" ]; then
+ # < XCode 4.3.1
+ XCODEBUILD_PATH=/Developer/usr/bin
+else
+ # >= XCode 4.3.1, or from App store
+ XCODEBUILD_PATH=/Applications/XCode.app/Contents/Developer/usr/bin
+fi
XCODEBUILD=$XCODEBUILD_PATH/xcodebuild
+test -x "$XCODEBUILD" || die "Could not find xcodebuild in $XCODEBUILD_PATH"
# Get the script path and set the relative directories used
# for compilation

0 comments on commit 0fb2954

Please sign in to comment.
Something went wrong with that request. Please try again.