release_libs_uniapp_imclient.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/sh
  2. TARGET_CLIENT_NAME=WFChatClient
  3. set -e
  4. CURRENT_PATH=`pwd`
  5. PRG="$0"
  6. PRGDIR=`dirname "$PRG"`
  7. cd $PRGDIR
  8. BUILD_DIR=`pwd`"/build"
  9. rm -rf "${BUILD_DIR}"
  10. mkdir -p "${BUILD_DIR}"
  11. #创建输出目录,并删除之前的framework文件
  12. UNIVERSAL_OUTPUT_FOLDER=`pwd`"/Libs&Resources"
  13. rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"
  14. mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}"
  15. #清理
  16. cd wfclient
  17. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean
  18. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean
  19. xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
  20. cd ..
  21. xcodebuild -create-xcframework -framework "${BUILD_DIR}"/Release-iphoneos/"${TARGET_CLIENT_NAME}".framework -output "${UNIVERSAL_OUTPUT_FOLDER}"/${TARGET_CLIENT_NAME}.xcframework
  22. rm -rf "${BUILD_DIR}"
  23. cd "${CURRENT_PATH}"