This repository has been archived by the owner on Mar 2, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild_all
executable file
·57 lines (49 loc) · 1.63 KB
/
build_all
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
#!/bin/bash
set -e
PROJECTS="templates/service templates/native templates/qml templates/hybrid-qml templates/html5 templates/hybrid-html5 demos/cpu-hybrid-qml"
if [[ -z $(which node) ]]; then
if [[ -z $(which apt-get) ]]; then
echo "NodeJS not installed. Please install it manually using the procedure described here:"
echo " https://nodejs.org/en/download/package-manager/"
exit 1
fi
echo "Installing node.js (Debian or compatible)"
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install nodejs
sudo npm install --global gulp
fi
TOPDIR=$(cd $(dirname $0) && pwd -P)
mkdir -p $TOPDIR/widgets
for project in $PROJECTS; do
echo "====================== BUILDING PROJECT $project ============================="
pushd $project
if [[ -f gulpfile.js ]]; then
[[ ! -d node_modules ]] && {
[[ -d $TOPDIR/node_modules ]] && ln -sf $TOPDIR/node_modules . || {
npm install
mv node_modules bower_components $TOPDIR
ln -sf $TOPDIR/node_modules .
ln -sf $TOPDIR/bower_components .
}
}
[[ ! -d bower_components ]] && {
[[ -d $TOPDIR/bower_components ]] && ln -sf $TOPDIR/bower_components || { echo "Bower components not found in $TOPDIR"; exit 1; }
}
fi
mkdir -p build
pushd build
cmake ..
make
cp -v *.wgt $TOPDIR/widgets/
popd
popd
done
echo "============================= BUILD FINISHED ================================="
echo "Available widgets:"
ls -l $TOPDIR/widgets
echo "To deploy: "
echo "# BOARDIP=1.2.3.4"
echo "# scp *.wgt root@\$BOARDIP:~/"
echo "# ssh root@\$BOARDIP"
echo "# for w in i\$(ls *.wgt); do afm-util install \$w; done"
echo "# afm-util list"