2
0

release_libs_uniapp.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. cd ../wfuikit
  27. xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
  28. cd ..
  29. xcodebuild -create-xcframework -framework "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework -output "${UNIVERSAL_OUTPUT_FOLDER}"/${TARGET_CLIENT_NAME}.xcframework
  30. xcodebuild -create-xcframework -framework "${BUILD_DIR}"/Release-iphoneos/"${TARGET_UIKIT_NAME}".framework -output "${UNIVERSAL_OUTPUT_FOLDER}"/${TARGET_UIKIT_NAME}.xcframework
  31. rm -rf "${BUILD_DIR}"
  32. ##依赖
  33. cp -af wfuikit/WFChatUIKit/AVEngine/WebRTC.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  34. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"/WebRTC.xcframework/ios-*-simulator
  35. cp -af wfuikit/WFChatUIKit/AVEngine/WFAVEngineKit.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  36. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"/WFAVEngineKit.xcframework/ios-*-simulator
  37. cp -af wfuikit/WFChatUIKit/Vendor/ZLPhotoBrowser/ZLPhotoBrowser.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  38. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"/ZLPhotoBrowser.xcframework/ios-*-simulator
  39. cp -af wfuikit/WFChatUIKit/Vendor/SDWebImage/SDWebImage.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
  40. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"/SDWebImage.xcframework/ios-*-simulator
  41. #打开合并后的文件夹
  42. open "${UNIVERSAL_OUTPUT_FOLDER}"
  43. cd "${CURRENT_PATH}"