forked from rossengeorgiev/habitat-mobile-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·45 lines (36 loc) · 1.62 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# compile stylesheet
echo -n "Compiling CSS... "
cd css
rm -f mobile.css
cat base.css skeleton.css layout.css habitat-font.css main.css > mobile.tmp
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=css mobile.tmp > mobile.css
rm -f mobile.tmp
cd ..
echo "Done!"
#compile javascript
echo -n "Compiling JavaScript... "
cd js
rm -f mobile.js init_plot.js
# precompiled libs
cat jquery* iscroll.js >> mobile.js
VERSION="`git rev-parse --short HEAD`"
# compile the rest
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge chasecar.lib.js | sed "s/{VER}/$VERSION/" >> mobile.js
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge nite-overlay.js >> mobile.js
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge tracker.js >> mobile.js
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge app.js >> mobile.js
#compile plot lib and config
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge _jquery.flot.js >> init_plot.js
java -jar "../tools/yuicompressor-2.4.8pre.jar" --type=js --disable-optimizations --nomunge plot_config.js >> init_plot.js
cd ..
echo "Done!"
echo -n "Increment cache version... "
CACHE_VERSION=`grep "# version" cache.manifest | grep -Po "\d+"`
CACHE_VERSION=`expr $CACHE_VERSION + 1`
mv cache.manifest cache.manifest.tmp
sed "s/^\(# version\) [0-9]\+/\1 $CACHE_VERSION/" cache.manifest.tmp > cache.manifest
rm -f cache.manifest.tmp
echo "Done!"
echo "Cache version: $CACHE_VERSION"
echo "Build version: $VERSION"