forked from waltheri/wgo.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·53 lines (46 loc) · 1.36 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
46
47
48
49
50
51
52
53
#!/bin/bash
TOPDIR=$(git rev-parse --show-toplevel)
# check if google closure compiler is installed
if [ ! -e "$TOPDIR/compiler/compiler.jar" ]; then
echo "Google closure compiler not found. Downloading it from "
echo
echo " http://dl.google.com/closure-compiler/compiler-latest.zip"
echo
echo "and extracting it to the bin/compiler folder."
echo
mkdir -p $TOPDIR/compiler
cd $TOPDIR/compiler
wget http://dl.google.com/closure-compiler/compiler-latest.zip
unzip compiler-latest.zip
fi
echo '-----------------------------'
echo ' Compressing JavaScript files'
echo '-----------------------------'
cd $TOPDIR/wgo
# compress wgo.js
java -jar $TOPDIR/compiler/compiler.jar \
--language_in ECMASCRIPT5 \
--js_output_file=_tmp.js wgo.js
# prepend licence information
echo -n '/*! MIT license, more info: wgo.waltheri.net */' > wgo.min.js
cat _tmp.js >> wgo.min.js
rm _tmp.js
# compress player
java -jar $TOPDIR/compiler/compiler.jar \
--language_in ECMASCRIPT5 \
--js_output_file=_tmp.js \
kifu.js \
sgfparser.js \
player.js \
basicplayer.js \
basicplayer.component.js \
basicplayer.infobox.js \
basicplayer.commentbox.js \
basicplayer.control.js \
player.editable.js \
scoremode.js \
player.permalink.js
# prepend licence information
echo -n '/*! MIT license, more info: wgo.waltheri.net */' > wgo.player.min.js
cat _tmp.js >> wgo.player.min.js
rm _tmp.js