forked from GoogleCloudPlatform/PerfKitExplorer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile.sh
executable file
·59 lines (49 loc) · 2.13 KB
/
compile.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
58
59
#!/bin/bash
echo "** Compilation initializing."
echo "* Clean out the existing deployment content."
rm -r -f deploy
echo "** Copying files."
echo "* Copy config files (yaml & appengine_config.py) to deploy."
find config -type f -name '*.json' | cpio -p -a -m -d --quiet deploy/
cp -f *.yaml ./deploy/
cp -f *.py ./deploy/
echo "* Copy server/*.py files (not tests) to deploy/server."
find server -type f -name '*.py' -not -iname '*_test.py' | cpio -p -a -m -d --quiet deploy/
echo "* Copy server/*.html files to deploy/server"
find server -type f -name '*.html' | cpio -p -a -m -d --quiet deploy/
echo "* Copy third_party/py/*.py files to deploy/server/third_party."
cd third_party/py
find . -type f -name '*.py' | cpio -p -a -m -d --quiet ../../deploy/server/third_party/
cd ../..
echo "* Copy client/*.html and json template files to deploy/client."
find client -name '*.html' | cpio -pamd --quiet deploy/
find client -name '*.json' | cpio -pamd --quiet deploy/
echo "* Copy third_party/js/*.* files to deploy/server/third_party."
cd third_party/js
find . -type f -name '*.*' | cpio -p -a -m -d --quiet ../../deploy/client/third_party/
cd ../..
echo "** Compiling files."
echo "* Compile client/*.js (not tests) to deploy/client/perfkit_scripts.js."
find client lib/closure-library/closure/goog \
-name '*_test.js' -prune \
-o -name 'karma.conf.js' -prune \
-o -name '*.js' -print | xargs \
java -jar bin/closure-compiler.jar \
--angular_pass \
--compilation_level=WHITESPACE_ONLY \
--language_in=ECMASCRIPT5 \
--formatting=PRETTY_PRINT \
--manage_closure_dependencies \
--only_closure_dependencies \
--process_closure_primitives true \
--closure_entry_point p3rf.perfkit.explorer.application.module \
--js_output_file=deploy/client/perfkit_scripts.js
echo "* Compile client/*.css stylesheets to deploy/client/perfkit_styles.css."
find client -name '*.css'| xargs \
java -jar bin/closure-stylesheets.jar \
--pretty-print \
--output-file deploy/client/perfkit_styles.css \
--allow-unrecognized-functions \
--allow-unrecognized-properties \
$1
echo "** Compilation complete."