-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.sh
executable file
·57 lines (44 loc) · 1.16 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
54
55
56
57
#!/bin/bash
ZIP=false
if [ $# -eq 1 ] && [ "$1" = "zip" ]
then
ZIP=true
fi
# remove existing build dir
echo "removing build"
rm -rf build/
# copy src as build
echo "copying src"
cp -r src/ build/
# move css file to base dir and remove css dir
echo "moving css"
cp build/css/content.css build/content.css
rm -rf build/css
# move options
echo "moving options"
cp build/options/* build/
rm -rf build/options
# move update page
echo "moving update page"
cp build/update/* build/
rm -rf build/update
# move popups
echo "moving popup page"
cp build/popup/* build/
rm -rf build/popup
# build js and remove src
FORMATTING=""
if [ $ZIP != true ]
then
FORMATTING="--formatting pretty_print"
fi
echo "compiling content.js"
find src/js/content/ -name "*.js" | xargs java -jar deps/compiler.jar --js_output_file build/content.js --compilation_level WHITESPACE_ONLY $FORMATTING --js
echo "compiling background.js"
find src/js/background/ -name "*.js" | xargs java -jar deps/compiler.jar --js_output_file build/background.js --compilation_level WHITESPACE_ONLY $FORMATTING --js
rm -rf build/js
if [ $ZIP = true ]
then
echo "zipping package"
zip -r pageruler.zip build
fi