-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdeploy-pod.sh
executable file
·69 lines (65 loc) · 3.13 KB
/
deploy-pod.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# 当前脚本存储地点
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# 输出CURRENT_DIR
echo "${CURRENT_DIR}"
# /Users/magic/Documents/bmob/Bmob-iOS-SDK
# 更改工作目录到脚本存储地点
cd "${CURRENT_DIR}/../Bmob-iOS/Bmob_iOS_Source_New/BmobMutiSDK/BmobSDK/"
echo "${CURRENT_DIR}/../Bmob-iOS/Bmob_iOS_Source_New/BmobMutiSDK/BmobSDK/"
# exit()
# 输入BmobSDK版本号
read -t 100 -p "INPUT THE VERSION OF THE BMOB_SDK : " version
# Sets the target folders and the final framework product.
echo "===> Start building the BmobSDK framework <==="
# 如果工程名称和Framework的Target名称不一样的话,要自定义FMKNAME
# 例如: FMK_NAME = "MyFramework",工程名
FMK_NAME='BmobSDK'
# Install dir will be the final output to the framework.
# The following line create it in the root folder of the current project.
# 存放的目录
INSTALL_DIR="${CURRENT_DIR}/${FMK_NAME}.framework"
# /Users/magic/Documents/bmob/Bmob-iOS-SDK/BmobSDK.framework
echo "${CURRENT_DIR}/${FMK_NAME}.framework"
# exit
# Working dir will be deleted after the framework creation.
# 设置生成针对模拟器的类库文件以及针对真机的类库的存放目录
WRK_DIR=build
DEVICE_DIR=${WRK_DIR}/Release/Release-iphoneos/${FMK_NAME}.framework
SIMULATOR_DIR=${WRK_DIR}/Debug/Debug-iphonesimulator/${FMK_NAME}.framework
# -configuration ${CONFIGURATION}
# Clean and Building both architectures.
xcodebuild -configuration "Release" -target "${FMK_NAME}" -sdk iphoneos SYMROOT=build/Release clean build
xcodebuild -configuration "Debug" -target "${FMK_NAME}" -sdk iphonesimulator SYMROOT=build/Debug VALID_ARCHS="x86_64" clean build
# xcodebuild -configuration "Debug" -target "${FMK_NAME}" -sdk iphonesimulator clean build
# exit
# Cleaning the oldest.移除旧的类库文件,fi是if的结束标记
if [ -d "${INSTALL_DIR}" ]
then
rm -rf "${INSTALL_DIR}"
fi
mkdir -p "${INSTALL_DIR}"
# 这句用来作什么?合并的只是BmobSDK文件,其余文件需要先复制过去,其余文件真机和虚拟机都是一样的
cp -R "${DEVICE_DIR}/" "${INSTALL_DIR}/"
# echo "${DEVICE_DIR}/${FMK_NAME}" "${SIMULATOR_DIR}/${FMK_NAME}" -output "${INSTALL_DIR}/${FMK_NAME}"
# exit
# Uses the Lipo Tool to merge both binary files (i386 + armv6/armv7) into one Universal final product.
lipo -create "${DEVICE_DIR}/${FMK_NAME}" "${SIMULATOR_DIR}/${FMK_NAME}" -output "${INSTALL_DIR}/${FMK_NAME}"
# 移除 build 目录
# rm -r "${WRK_DIR}"
# 更改工作目录回脚本存储点
cd ${CURRENT_DIR}
echo ${CURRENT_DIR}
echo "===> BmobSDK framework is built, start modifing the CFBundleShortVersionString <==="
# 修改plist文件中的版本号
/usr/libexec/PlistBuddy -c "set :CFBundleShortVersionString ${version}" "${CURRENT_DIR}/BmobSDK.framework/Info.plist"
# git操作
# echo "|=====> STARTING THE GIT ACTION <=====|"
# git add .
# git commit -m "[$(date +'%Y-%m-%d %H:%M:%S')][VV][SDK${version}]"
# git push origin master
# echo "|=====> THE PUSH IS DONE,START ADDING THE TAG <=====|"
# git tag "${version}"
# git push --tags
# echo "|=====> THE GIT ACTION IS DONE, TRY TRUNK PUSH NOW <=====|"
# # pod trunk push
# pod trunk push "${CURRENT_DIR}/BmobSDK.podspec" --allow-warnings