# First build the OS X framework to get its folder structure. xcodebuild -configuration Release -target OCHamcrest -sdk macosx # We'll copy the OS X framework to a new location, then modify it in place. OSX_FRAMEWORK="build/Release/OCHamcrest.framework/" IOS_FRAMEWORK="build/Release/OCHamcrestIOS.framework/" # Trigger builds of the static library for both the simulator and the device. xcodebuild -configuration Release -target libochamcrest -sdk iphoneos OUT=$? if [ "${OUT}" -ne "0" ]; then echo Device build failed exit ${OUT} fi xcodebuild -configuration Release -target libochamcrest -sdk iphonesimulator OUT=$? if [ "${OUT}" -ne "0" ]; then echo Simulator build failed exit ${OUT} fi # Copy the OS X framework to the new location. mkdir -p "${IOS_FRAMEWORK}" rsync -q -a --delete "${OSX_FRAMEWORK}" "${IOS_FRAMEWORK}" # Rename the main header. mv "${IOS_FRAMEWORK}/Headers/OCHamcrest.h" "${IOS_FRAMEWORK}/Headers/OCHamcrestIOS.h" # Update all imports to use the new framework name. IMPORT_EXPRESSION="s/#import