注意:路径和appName不要含有空格
#!/bin/sh
CURRENT_DATE=$(
date +%Y%m%d-%H%M%S
)
findme()
{
dir=$(dirname "$1")
cd "${dir}"
pwd
}
cmd=install
mode=Debug
srcroot=$(findme "$0")
sympath="$DIR_SRC/tmp/Symroot"-$(md5 -qs "${srcroot}")
symroot="SYMROOT=${sympath}"
#打包名
overlay_dir="$DIR_SRC/tmp/B837_HoistingTest"
overlay_atlas="${overlay_dir}/Users/gdlocal/Library/Atlas"
################################## App Code Start ##############################################################
#最终打包存放的位置
SOURCECODE_ROOT="${srcroot}/Overlay/Applications"
echo "PLUGIN DIR ------->"
echo "${SOURCECODE_ROOT}"
BUILD_LIST=" \
HoistingTest \
"
#进入Bundle Code文件夹
cd "SourceCode"
pwd
print_banner()
{
echo "\n********************************************************************************"
echo "[$1]"
echo "********************************************************************************\n"
sleep 1;
}
deleteOldBundle(){
echo "\n*删除老的application:${SOURCECODE_ROOT}/${i}.app"
rm -rf "${SOURCECODE_ROOT}/${i}.app"
}
build_modules()
{
for i
do
(
cd "${i}"
pwd
deleteOldBundle "${i}"
print_banner "building [${i}]"
xcodebuild -configuration $mode $cmd "SKIP_INSTALL=YES"
#删除老的app
if [ -d ${SOURCECODE_ROOT}/${i}.app ]
then
rm -r ${SOURCECODE_ROOT}/${i}.app
fi
echo "删除老的app完成"
if [ -d "build/UninstalledProducts/macosx" ]
then
macosx="macosx"
fi
echo "cp ------------------start"
cp -R build/UninstalledProducts/macosx/*.app ${SOURCECODE_ROOT}
echo "cp ------------------end"
cd ..
) || exit $?
done
}
build_modules $BUILD_LIST
print_banner "App Build Process Is Complete !!"
################################## App Code END ##############################################################
################################## 移动到 Overlay/Applications ##############################################################
################################## zip ##############################################################
rm -rf "${overlay_dir}"
cd $srcroot
ditto "Overlay" "${overlay_dir}"
echo "current path"
echo $overlay_dir
cd $srcroot
pwd
echo "Zipping..."
ditto -ck --keepParent $overlay_dir "${overlay_dir}.zip"
openssl sha1 "${overlay_dir}.zip"
网友评论