Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Merge Script
- # 1
- # Set bash script to exit immediately if any commands fail.
- set -e
- # 2
- # Setup some constants for use later on.
- FRAMEWORK_NAME="NAME"
- # 3
- # Build the framework for device and for simulator (using
- # all needed architectures).
- xcodebuild -target "${FRAMEWORK_NAME}" \
- -sdk iphoneos \
- -configuration Debug \
- OTHER_CFLAGS="-fembed-bitcode -Qunused-arguments" \
- ONLY_ACTIVE_ARCH=NO \
- DEPLOYMENT_POSTPROCESSING=YES \
- CLANG_MODULES_AUTOLINK=YES \
- MACH_O_TYPE=staticlib \
- IPHONEOS_DEPLOYMENT_TARGET=8.0 \
- CONFIGURATION_BUILD_DIR="${SRCROOT}/../build/iphones" \
- clean build
- xcodebuild -target "${FRAMEWORK_NAME}" \
- -sdk iphonesimulator \
- -configuration Debug \
- OTHER_CFLAGS="-fembed-bitcode -Qunused-arguments" \
- ONLY_ACTIVE_ARCH=NO \
- DEPLOYMENT_POSTPROCESSING=YES \
- CLANG_MODULES_AUTOLINK=YES \
- MACH_O_TYPE=staticlib \
- IPHONEOS_DEPLOYMENT_TARGET=8.0 \
- CONFIGURATION_BUILD_DIR="${SRCROOT}/../build/iphonesimulator" \
- clean build
- # 4
- # Remove .framework file if exists on Release dir from previous run.
- if [ -d "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework" ]; then
- rm -rf "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework"
- fi
- # 5
- # Copy the simulator version of framework to Desktop.
- rm -rf "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/_CodeSignature"
- mkdir -p "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework"
- cp -r "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/" "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/"
- rm -rf "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/Info.plist"
- # 6
- # Replace the framework executable within the framework with
- # a new version created by merging the device and simulator
- # frameworks' executables with lipo.
- lipo -create -output "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" \
- "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" \
- "${SRCROOT}/../build/iphones/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"
Add Comment
Please, Sign In to add comment