Guest User

Untitled

a guest
Apr 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. # Merge Script
  2.  
  3. # 1
  4. # Set bash script to exit immediately if any commands fail.
  5. set -e
  6.  
  7. # 2
  8. # Setup some constants for use later on.
  9. FRAMEWORK_NAME="NAME"
  10.  
  11. # 3
  12. # Build the framework for device and for simulator (using
  13. # all needed architectures).
  14. xcodebuild -target "${FRAMEWORK_NAME}" \
  15. -sdk iphoneos \
  16. -configuration Debug \
  17. OTHER_CFLAGS="-fembed-bitcode -Qunused-arguments" \
  18. ONLY_ACTIVE_ARCH=NO \
  19. DEPLOYMENT_POSTPROCESSING=YES \
  20. CLANG_MODULES_AUTOLINK=YES \
  21. MACH_O_TYPE=staticlib \
  22. IPHONEOS_DEPLOYMENT_TARGET=8.0 \
  23. CONFIGURATION_BUILD_DIR="${SRCROOT}/../build/iphones" \
  24. clean build
  25.  
  26. xcodebuild -target "${FRAMEWORK_NAME}" \
  27. -sdk iphonesimulator \
  28. -configuration Debug \
  29. OTHER_CFLAGS="-fembed-bitcode -Qunused-arguments" \
  30. ONLY_ACTIVE_ARCH=NO \
  31. DEPLOYMENT_POSTPROCESSING=YES \
  32. CLANG_MODULES_AUTOLINK=YES \
  33. MACH_O_TYPE=staticlib \
  34. IPHONEOS_DEPLOYMENT_TARGET=8.0 \
  35. CONFIGURATION_BUILD_DIR="${SRCROOT}/../build/iphonesimulator" \
  36. clean build
  37.  
  38. # 4
  39. # Remove .framework file if exists on Release dir from previous run.
  40. if [ -d "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework" ]; then
  41. rm -rf "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework"
  42. fi
  43.  
  44. # 5
  45. # Copy the simulator version of framework to Desktop.
  46. rm -rf "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/_CodeSignature"
  47. mkdir -p "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework"
  48. cp -r "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/" "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/"
  49. rm -rf "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/Info.plist"
  50.  
  51. # 6
  52. # Replace the framework executable within the framework with
  53. # a new version created by merging the device and simulator
  54. # frameworks' executables with lipo.
  55. lipo -create -output "${SRCROOT}/../Release/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" \
  56. "${SRCROOT}/../build/iphonesimulator/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" \
  57. "${SRCROOT}/../build/iphones/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"
Add Comment
Please, Sign In to add comment