-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·89 lines (65 loc) · 1.6 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·89 lines (65 loc) · 1.6 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
86
87
88
89
#!/bin/bash
set -xe
source vendor/unoroms/scripts/functions.sh
printHeader
checkInputParams $*
unoromdir="vendor/unoroms"
manufac=$1
device=$2
lunchCombo=$3
maketarget=$4
devicebranch=$5
deviceid=$manufac_$device
devicedir="$unoromdir/devices/$manufac/$device"
lastSyncFile="lastSuccessRepoSync_$device_$devicebranch"
if ( isArgumentNull "$6" )
then
jobs=8
else
jobs=$6
fi
echo "Using jobs : $jobs"
repo sync -j$jobs -f $unoromdir/devices
rm -f .repo/local_manifests/unoroms_*.xml
cp $devicedir/manifest.xml .repo/local_manifests/unoroms_$deviceid.xml
CURRTIME=`date "+%Y-%m-%d %H:%M"`
echo $CURRTIME
repo sync -j$jobs -f
if [ -f $unoromdir/devices/romPatch.sh ]
then
. $unoromdir/devices/romPatch.sh
fi
if [ -f $devicedir/deviceSpecificPatch.sh ]
then
. $devicedir/deviceSpecificPatch.sh
fi
if [ "$(ls -A $devicedir/overrides )" ]
then
cp -R $devicedir/overrides/* device/$manufac/$device/
fi
rm -rf out/target/product/$device
if [ -f $lastSyncFile ]
then
LASTTIME=$(cat $lastSyncFile)
repo forall -p -c git log --since="$LASTTIME" --oneline > changelog
if [ ! -s changelog ]
then
echo "No changes... Not building"
exit 0
fi
fi
. build/envsetup.sh
lunch $lunchCombo
make -j$jobs $maketarget
CHANGELOG=`ls out/target/product/$device/ | grep md5sum | sed s/md5sum/changelog/g`
if ( isArgumentNull "$CHANGELOG" )
then
CHANGELOG=`ls out/target/product/$device/ | grep md5 | sed s/md5/changelog/g`
fi
if [ -f changelog ]
then
mv changelog out/target/product/$device/$CHANGELOG
else
echo "Initial Release" > out/target/product/$device/$CHANGELOG
fi
echo $CURRTIME > $lastSyncFile