forked from cylankj/IoTKit-App-Android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·29 lines (26 loc) · 878 Bytes
/
build.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
timeStart=$(($(date +%s)))
vCode=""
vName=""
#定义输出目录名称
packageDir=`date '+%Y%m%d%H%M'`
mkdir -p $1/$packageDir/channel
outputDir=$1
#!/bin/bash
while IFS='' read -r line || [[ -n "$line" ]]; do
#提取versionCode
if [[ $line == *"versionCode"* ]]; then
vCode=`echo $line | sed -e "s/versionCode=//g"`
echo "vCode:" $vCode
fi
#提取versionName
if [[ $line == *"versionName"* ]]; then
vName=`echo $line | sed -e "s/versionName=//g"`
echo "vCode:" $vName
fi
done <version.properties
./gradlew assemble_test1
mkdir -p $outputDir
mv app/build/outputs/apk/app-_test1-release.apk "$outputDir"/com.cylan.jiafeigou.test1_release_v$vName-$vCode.apk
mv app/build/outputs/apk/app-_test1-debug.apk "$outputDir"/com.cylan.jiafeigou.test1_debug_v$vName-$vCode.apk
timeEnd=$(($(date +%s)))
echo "耗时: "$(($timeEnd - $timeStart))"s"