diff options
Diffstat (limited to 'tools/autobuild/detect_xcode.sh')
-rw-r--r-- | tools/autobuild/detect_xcode.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/autobuild/detect_xcode.sh b/tools/autobuild/detect_xcode.sh new file mode 100644 index 0000000000..a57c9ac78b --- /dev/null +++ b/tools/autobuild/detect_xcode.sh @@ -0,0 +1,35 @@ +# Add your paths into these arrays +KNOWN_IOS_SDK_PATHS=( \ + /Applications/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk \ + /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/ +) + +KNOWN_IOS_SDK_SIMULATOR_PATHS=( \ + /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk \ + /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk +) + + +# Prints path to directory with iOS SDK +# Pameter is configuration name: <debug|release|production|simulator> +# Returns 1 in case of not found and 0 in case of success +PrintIOSSDKPath() { + PATHS_ARRAY="${KNOWN_IOS_SDK_PATHS[@]}" + if [[ $1 == "simulator" ]]; then + for path in "${KNOWN_IOS_SDK_SIMULATOR_PATHS[@]}"; do + if [ -d "${path}" ]; then + echo "${path}" + return 0 + fi + done + else + for path in "${KNOWN_IOS_SDK_PATHS[@]}"; do + if [ -d "${path}" ]; then + echo "${path}" + return 0 + fi + done + fi + # Not found + return 1 +} |