1 Star 6 Fork 8

河南火之夜电子科技有限公司 / shell_pack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pack_apk.sh 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
TT 提交于 2024-06-26 16:25 . 添加generic='generic/platform=iOS'
#!/bin/bash
###
# @Descripttion:
# @version:
# @Author: TT
# @Date: 2022-08-31 09:48:41
# @LastEditors: TT
# @LastEditTime: 2023-07-17 17:46:39
###
# shellcheck disable=SC1091
# shellcheck disable=SC2154
source ./pack_config.sh
source ./pgyer_upload.sh
chmod a+x pgyer_upload.sh
flutterBuild() {
echo "$build_type"
echoMsg "$upload_type"
flutter build apk --no-shrink --dart-define=CHANNEL="$1" --dart-define=DEBUG="$build_type" --"$build_type" --no-tree-shake-icons
if [[ $project_build_type == 1 ]]; then
cp -R "$flutter_release_apk_path"*.apk "$export_apk_release_path"
else
cp -R "$flutter_debug_apk_path"*.apk "$export_apk_debug_path"
fi
}
# 构建渠道包
apkBuild() {
echoMsg "开始打包"
if [[ $apk_chanhels_length == 0 || $upload_type == 2 ]]; then
flutterBuild "Normal"
elif [[ $pack_apk_channel == 0 && $apk_chanhels_length != 0 ]]; then
echoMsg "开始构建: 全部渠道包"
for ((i = 0; i < "$apk_chanhels_length"; i++)); do
echoMsg "正在构建: ${apk_channels[$i]}渠道包"
flutterBuild apk_channels["$i"]
done
else
flutterBuild apk_channels["$pack_apk_channe"]
fi
}
# 打包apk
buidApk() {
mycmd=apkBuild
echo "$mycmd"
if $mycmd; then
if [ "$project_build_type" == 1 ]; then
expord_path="$export_apk_release_path"
else
expord_path="$export_apk_debug_path"
fi
echoMsg "$upload_type"
if [ "$upload_type" == 2 ]; then
# echo 开始上传蒲公英
for f in "$expord_path"*.apk; do
[[ -e "$f" ]] || break
echo "$f"
uploadPgyer "$api_key" "$f"
done
else
echoMsg "apk 打包成功"
open "$export_apk_release_path"
fi
else
echoMsg "apk 打包失败"
fi
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hot_night/shell_pack.git
git@gitee.com:hot_night/shell_pack.git
hot_night
shell_pack
shell_pack
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891