-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcompile
More file actions
executable file
·66 lines (59 loc) · 2.1 KB
/
compile
File metadata and controls
executable file
·66 lines (59 loc) · 2.1 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
timestamp=$(date "+%Y_%m_%d_%H_%M_%S")
#!/bin/bash
#this toolchain requires the same stuff to be installed in the same places as puzzlescript - see here for how to use
#https://groups.google.com/forum/#!searchin/puzzlescript/development/puzzlescript/yptIpY9hlng/cjfrOPy_4jcJ
#also requires https://www.npmjs.com/package/html-minifier
echo generating font example silhouettes
cd images/fonts
./genblacks
cd ../../
cd haxegonweb
./releasebuild
cd ..
./processwebthing
./docbuild
rm -rf bin
echo copying directory
cd ..
cp -R zeedonk zeedonkbin
mv zeedonkbin zeedonk/bin
cd zeedonk
rm -rf bin/haxegonweb
rm -rf bin/.[^.]*
cp htaccess bin/.htaccess
cd js
./closurecompile
cd ..
echo optimizing images
rm bin/images/*.png
cd images
./minimize
cd ..
echo building css
cd css
./concat
cd ../
echo generating editor.html
sed -e 's/<link rel="stylesheet" href="[A-Za-z0-9_\/-]*\.css">//g' < editor.html > _editor2.html
sed -e 's/<!--CSSREPLACE-->/<link rel="stylesheet" href="css\/combined_'$timestamp'.css">/' < _editor2.html > _editor3.html
sed -e 's/<script type="text\/javascript" src="[A-Za-z0-9\._\/-]*\.js"><\/script>//g' < _editor3.html > _editor4.html
sed -e 's/<!--TOREPLACE-->/<script type="text\/javascript" src="js\/compiled_'$timestamp'.js"><\/script>/g' < _editor4.html > _editor5.html
echo generating play.html
sed -e 's/<script type="text\/javascript" src="[A-Za-z0-9\.\-_\/]*\.js"><\/script>//g' < play.html > _play4.html
sed -e 's/<!--TOREPLACE-->/<script type="text\/javascript" src="js\/player_compiled_'$timestamp'.js"><\/script>/g' < _play4.html > _play5.html
mv css/combined.css bin/css/combined_$timestamp.css
mv js/compiled.js bin/js/compiled_$timestamp.js
mv js/player_compiled.js bin/js/player_compiled_$timestamp.js
mv _editor5.html bin/editor.html
mv _play5.html bin/play.html
rm _*.html
echo gzipping
cd bin
./gzipper
cd ..
cd bin
html-minifier editor.html --remove-comments --collapse-whitespace --minify-css -o editor.html
html-minifier play.html --remove-comments --collapse-whitespace --minify-css -o play.html
cd ..
finishedcompiling=$(date "+%Y_%m_%d_%H_%M_%S")
echo "finished compiling at "$finishedcompiling