]> jfr.im git - irc/quakenet/qwebirc.git/blob - compile.sh
Try not to corrupt the namespaces.
[irc/quakenet/qwebirc.git] / compile.sh
1 #!/bin/sh
2 mkdir -p compiled
3 rm -f compiled/*.js
4
5 cd js
6 cat qwebirc.js version.js jslib.js irc/ircconnection.js irc/irclib.js irc/baseircclient.js irc/irctracker.js irc/commandparser.js irc/ircclient.js ui/baseui.js ui/baseuiwindow.js ui/colour.js ui/url.js ui/theme.js ui/genericlogin.js ui/embedwizard.js irc/commandhistory.js qwebircinterface.js > ../compiled/qwebirc-concat.js
7 cat ui/swmui.js ui/swmlayout.js > ../compiled/swmui-concat.js
8
9 error() {
10 cd ..
11 rm compiled/*-compiled.js
12 exit 1
13 }
14
15 catit() {
16 cat js/copyright.js compiled/$1-compiled.js > static/js/$1.js
17 }
18
19 xjarit() {
20 local SRC=$1
21 local DST=$2
22 cd compiled
23 java -jar ../bin/yuicompressor-2.3.5.jar $SRC.js > $DST.js
24 if [ "$?" != 0 ]; then
25 error
26 fi
27 cd ..
28 }
29
30 jarit() {
31 SRC=$1
32 DST=$2
33
34 xjarit $SRC $DST-compiled
35 catit $DST
36 rm compiled/$DST-compiled.js
37 }
38
39 cd ..
40 xjarit ../static/js/mochaui/mocha ../static/js/mochaui/mocha-compressed
41
42 jarit qwebirc-concat qwebirc
43 jarit ../js/ui/uglyui uglyui
44 jarit swmui-concat swmui
45 jarit ../js/ui/mochaui mochaui
46 jarit ../js/ui/qui qui
47
48 rm compiled/{swmui,qwebirc}-concat.js
49
50 rmdir compiled