-
Notifications
You must be signed in to change notification settings - Fork 507
/
release_libs.sh
executable file
·54 lines (41 loc) · 2.58 KB
/
release_libs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
TARGET_CLIENT_NAME=WFChatClient
TARGET_UIKIT_NAME=WFChatUIKit
set -e
CURRENT_PATH=`pwd`
PRG="$0"
PRGDIR=`dirname "$PRG"`
cd $PRGDIR
BUILD_DIR=`pwd`"/build"
rm -rf "${BUILD_DIR}"
mkdir -p "${BUILD_DIR}"
#创建输出目录,并删除之前的framework文件
UNIVERSAL_OUTPUT_FOLDER=`pwd`"/Libs&Resources"
rm -rf "${UNIVERSAL_OUTPUT_FOLDER}"
mkdir -p "${UNIVERSAL_OUTPUT_FOLDER}"
#清理
cd wfclient
xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean
xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean
cd ../wfuikit
xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" clean
xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" clean
#分别编译模拟器和真机的Framework
cd ../wfclient
xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
xcodebuild -target ${TARGET_CLIENT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" build
cd ../wfuikit
xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=YES -arch arm64 -configuration Release -sdk iphoneos BUILD_DIR="${BUILD_DIR}" build
xcodebuild -target ${TARGET_UIKIT_NAME} ONLY_ACTIVE_ARCH=NO -configuration Release -sdk iphonesimulator BUILD_DIR="${BUILD_DIR}" build
cd ..
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
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
rm -rf "${BUILD_DIR}"
##依赖
cp -af wfuikit/WFChatUIKit/AVEngine/WebRTC.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
cp -af wfuikit/WFChatUIKit/AVEngine/WFAVEngineKit.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
cp -af wfuikit/WFChatUIKit/Vendor/ZLPhotoBrowser/ZLPhotoBrowser.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
cp -af wfuikit/WFChatUIKit/Vendor/SDWebImage/SDWebImage.xcframework "${UNIVERSAL_OUTPUT_FOLDER}"
#打开合并后的文件夹
open "${UNIVERSAL_OUTPUT_FOLDER}"
cd "${CURRENT_PATH}"