1 Star 0 Fork 8

Steven.zhao/shell_pack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pack_clear_create_tool.sh 2.54 KB
一键复制 编辑 原始数据 按行查看 历史
TT 提交于 2023-07-17 17:51 . apk --no-tree-shake-icons
#!/bin/bash
# shellcheck disable=SC1091
# shellcheck disable=SC2154
source ./pack_config.sh
chmod a+x pack_config.sh
# =========================== 清除模块 =========================== #
# 清理iOS文件
clearIosLib() {
echomsg "清理IOS文件夹"
if [ -d "${export_ios_path}" ]; then
rm -rf "${export_ios_path}"
fi
echomsg "清理IOS文件夹成功"
}
# 清理iOS Build缓存
clearIosBuild() {
if [ -d "${project_path}"/ios ]; then
echomsg "清理XCODE"
xcodebuild clean -workspace "${project_workspace_path}" -scheme "${project_scheme}" -configuration "${build_type}" -quiet || exit
fi
}
# 清理 Android文件
clearAndroidLib() {
echomsg "清理Android文件"
if [[ $project_build_type == 1 ]]; then
if [ -d "${export_apk_release_path}" ]; then
rm -rf "${export_apk_release_path}"
fi
else
if [ -d "${export_apk_debug_path}" ]; then
rm -rf "${export_apk_debug_path}"
fi
fi
}
# 清理 Flutter缓存
clearFlutter() {
if [ -e "${project_path}"/pubspec.yaml ]; then
echo '清理FLUTTER'
flutter clean
fi
}
# 清理iOS
clearIos() {
clearIosLib
clearIosBuild
}
# 清理Android
clearAndroid() {
clearAndroidLib
}
# 清理工程
cleanFun() {
echomsg "$project_is_clear"
if [ "$project_is_clear" == 1 ]; then
if [ "$pack_os" == 0 ]; then
clearIos
clearAndroid
elif [ "$pack_os" == 1 ]; then
clearAndroid
else
clearIos
fi
clearFlutter
echo "清理END"
fi
}
# =========================== 构建模块 =========================== #
# 构建Android文件夹
createAndroidLib() {
echomsg "创建Android文件中"
if [[ $project_build_type == 1 ]]; then
if [ ! -d "${export_apk_release_path}" ]; then
mkdir -p "${export_apk_release_path}"
fi
else
if [ ! -d "${export_apk_debug_path}" ]; then
mkdir -p "${export_apk_debug_path}"
fi
fi
}
# 构建iOS文件夹
createIosLib() {
echomsg "创建IOS文件中"
if [ ! -d "${export_xcarchive_path}" ]; then
mkdir -p "${export_xcarchive_path}"
fi
if [ ! -d "${export_ipa_path}" ]; then
mkdir -p "${export_ipa_path}"
fi
echo "$export_xcarchive_path"
}
createLib() {
if [ "$pack_os" == 0 ]; then
createIosLib
createAndroidLib
elif [ "$pack_os" == 1 ]; then
createAndroidLib
else
createIosLib
fi
echomsg "文件创建完成"
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/zhao187/shell_pack.git
git@gitee.com:zhao187/shell_pack.git
zhao187
shell_pack
shell_pack
master

搜索帮助