This repository has been archived by the owner on May 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 264
/
compress.sh
executable file
·56 lines (42 loc) · 1.67 KB
/
compress.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
#!/bin/sh
UGLIFY=`which uglifyjs 2> /dev/null`
if [ ! -x "$UGLIFY" ]; then
echo "uglifyjs not found in your path. can't create production resources. disaster."
exit 1
fi
JAVA=`which java 2> /dev/null`
if [ ! -x "$JAVA" ]; then
echo "java not found in your path. can't create production resources. disaster."
exit 1
fi
YUI_LOCATION=`pwd`'/static/steal/build/scripts/yui.jar'
echo ''
echo '****Compressing include.js****'
echo ''
cd static
mv include.js include.orig.js
$UGLIFY -nc include.orig.js > include.js
echo ''
echo '****Building dialog HTML, CSS, and JS****'
echo ''
steal/js dialog/scripts/build.js
cd dialog
$UGLIFY < production.js > production.min.js
mv production.min.js production.js
cd css
cat popup.css m.css > production.css
$JAVA -jar $YUI_LOCATION production.css -o production.min.css
cd ../../relay
cat ../dialog/resources/jschannel.js relay.js > production.js
$UGLIFY < production.js > production.min.js
mv production.min.js production.js
echo ''
echo '****Building BrowserID.org HTML, CSS, and JS****'
echo ''
cd ../js
# re-minimize everything together
cat jquery-1.6.2.min.js json2.js browserid.js ../dialog/resources/underscore-min.js ../dialog/resources/browserid-extensions.js ../dialog/resources/storage.js ../dialog/resources/browserid-network.js ../dialog/resources/browserid-identities.js ../dialog/resources/tooltip.js ../dialog/resources/validation.js pages/index.js pages/add_email_address.js pages/verify_email_address.js pages/manage_account.js pages/signin.js pages/signup.js pages/forgot.js > lib.js
$UGLIFY < lib.js > lib.min.js
cd ../css
cat style.css m.css > browserid.css
$JAVA -jar $YUI_LOCATION browserid.css -o browserid.min.css