This repository was archived by the owner on Jun 7, 2018. It is now read-only.
forked from Halium/halium-devices
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·44 lines (34 loc) · 1.33 KB
/
setup
File metadata and controls
executable file
·44 lines (34 loc) · 1.33 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
#!/bin/bash
DEVICE=${1:=${DEVICE}}
JOBS=${JOBS:=12}
DEVICES_ROOT="$(dirname "$(readlink -f "${0}")")"
REPO_ROOT="${DEVICES_ROOT}/../.."
if [ -z $DEVICE ]; then
echo "Please specify a device codename"
exit 0
fi
if ! [ -f $DEVICES_ROOT/manifests/*_$DEVICE.xml ]; then
echo "The given device is not supported. :("
else
echo "*****************************************"
echo "I: Configuring for device $DEVICE"
echo "*****************************************"
# Test if there is already a device configured and the folder exists
if [ -f $REPO_ROOT/.repo/local_manifests/device.xml ]; then
rm $REPO_ROOT/.repo/local_manifests/device.xml
elif ! [ -d $REPO_ROOT/.repo/local_manifests/ ]; then
mkdir $REPO_ROOT/.repo/local_manifests/
fi
# Link the device manifest to the local_manifests folder
ln $DEVICES_ROOT/manifests/*_$DEVICE.xml $REPO_ROOT/.repo/local_manifests/device.xml
# Synchronize new new sources
repo sync --network-only -c -j$JOBS -q
repo sync --local-only -c -j$JOBS -q
# Refresh the vendor repository so apks and jars are not copied
# For this to work, all apks and jars need to be removed from device/$vendor/$codename/proprietary-files.txt
DEVICE_TREE=$REPO_ROOT/device/*/$DEVICE
if [ -f $DEVICE_TREE/setup-makefiles.sh ]; then
echo "I: Refreshing vendor repository"
(cd $DEVICE_TREE; ./setup-makefiles.sh)
fi
fi