forked from maidoudou1/Flyme_device_A0001
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·85 lines (65 loc) · 1.72 KB
/
build.sh
File metadata and controls
executable file
·85 lines (65 loc) · 1.72 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#
#Flyme auto make script
buildDir=/home/leon/android/flyme/build
pwd=$PWD
function initEnv() {
echo ">>> 初始化编译环境"
source ../../build/envsetup.sh
cd $pwd
}
function makeFull() {
echo ">>> 编译全量包"
flyme cleanall
flyme fullota
if [ -e out/flyme*.zip ];then
cd out
beforeName=$(basename flyme*.zip)
versionName=${beforeName##*_}
mv flyme*.zip Flyme_A0001_Leon_$versionName
mv target*.zip target_files.zip
cd ..
echo "<<< 全量包编译完成"
else
echo "<<< 全量包编译失败"
fi
}
function makeOTA() {
echo "是否编译OTA包?(Y/n)"
read keyboard
case $keyboard in
Y|y|YES|yes)
echo ">>> 编译OTA包"
$buildDir/tools/releasetools/ota_from_target_files -k $buildDir/security/testkey -i history_package/last_target_files.zip out/target_files.zip out/OTA_Flyme_A0001_$versionName
echo "<<< OTA包编译完成"
esac
cleanCache
}
function cleanCache(){
echo ">>> 清除缓存文件"
if [ -e out/Flyme*.zip ];then
rm -rf history_package
mkdir history_package
mkdir Flyme_Done
mv out/target_files.zip history_package
mv out/Flyme*.zip Flyme_Done
if [ -e out/OTA*.zip ];then
mv out/OTA*.zip Flyme_Done
fi
mv history_package/target_files.zip history_package/last_target_files.zip
fi
flyme cleanall
}
function printUseTime() {
let "okTime=$endTime-$startTime"
let "okH=$okTime/60"
let "okMin=$okTime%60"
echo "<<< 完成"
echo "<<< 耗时$okH分$okMin秒"
}
startTime=`date +%s`
initEnv
makeFull
makeOTA
endTime=`date +%s`
printUseTime