release_legacy_libs.sh 1.3 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. TARGET_CLIENT_NAME=WFChatClient
  3. TARGET_UIKIT_NAME=WFChatUIKit
  4. set -e
  5. BUILD_DIR=`pwd`"/build"
  6. rm -rf "${BUILD_DIR}"
  7. mkdir -p "${BUILD_DIR}"
  8. UNIVERSAL_OUTPUT_FOLDER=`pwd`"/Libs&Resources"
  9. #创建输出目录,并删除之前的framework文件
  10. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"
  11. mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}"
  12. #清理
  13. cd wfclient
  14. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean build
  15. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch x86_64 -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean build
  16. lipo -create "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework/"${TARGET_CLIENT_NAME}" "${BUILD_DIR}"/Release-iphonesimulator/"${TARGET_CLIENT_NAME}".framework/"${TARGET_CLIENT_NAME}" -output "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework/tmp_bin
  17. mv -f "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework/tmp_bin "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework/"${TARGET_CLIENT_NAME}"
  18. mv -f "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework "${UNIVERSAL_OUTPUT_FOLDER}"
  19. rm -rf "${BUILD_DIR}"
  20. #打开合并后的文件夹
  21. open "${UNIVERSAL_OUTPUT_FOLDER}"