2
0

release_libs.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/sh
  2. TARGET_CLIENT_NAME=WFChatClient
  3. TARGET_UIKIT_NAME=WFChatUIKit
  4. set -e
  5. CURRENT_PATH=`pwd`
  6. PRG="$0"
  7. PRGDIR=`dirname "$PRG"`
  8. cd $PRGDIR
  9. BUILD_DIR=`pwd`"/build"
  10. rm -rf "${BUILD_DIR}"
  11. mkdir -p "${BUILD_DIR}"
  12. #创建输出目录,并删除之前的framework文件
  13. UNIVERSAL_OUTPUT_FOLDER=`pwd`"/Libs&Resources"
  14. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"
  15. mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}"
  16. #清理
  17. cd wfclient
  18. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean
  19. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean
  20. cd ../wfuikit
  21. xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean
  22. xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean
  23. #分别编译模拟器和真机的Framework
  24. cd ../wfclient
  25. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
  26. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" build
  27. cd ../wfuikit
  28. xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
  29. xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" build
  30. cd ..
  31. xcodebuild -create-xcframework -framework "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework -framework "${BUILD_DIR}"/Release-iphonesimulator/"${TARGET_CLIENT_NAME}".framework -output "${UNIVERSAL_OUTPUT_FOLDER}"/${TARGET_CLIENT_NAME}.xcframework
  32. xcodebuild -create-xcframework -framework "${BUILD_DIR}"/Release-iphoneos/"${TARGET_UIKIT_NAME}".framework -framework "${BUILD_DIR}"/Release-iphonesimulator/"${TARGET_UIKIT_NAME}".framework -output "${UNIVERSAL_OUTPUT_FOLDER}"/${TARGET_UIKIT_NAME}.xcframework
  33. rm -rf "${BUILD_DIR}"
  34. ##依赖
  35. cp -af wfuikit/WFChatUIKit/AVEngine/WebRTC.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  36. cp -af wfuikit/WFChatUIKit/AVEngine/WFAVEngineKit.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  37. cp -af wfuikit/WFChatUIKit/Vendor/ZLPhotoBrowser/ZLPhotoBrowser.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  38. cp -af wfuikit/WFChatUIKit/Vendor/SDWebImage/SDWebImage.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  39. #打开合并后的文件夹
  40. open "${UNIVERSAL_OUTPUT_FOLDER}"
  41. cd "${CURRENT_PATH}"