-
Notifications
You must be signed in to change notification settings - Fork 786
/
bootstrap
executable file
·83 lines (69 loc) · 2.94 KB
/
bootstrap
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/sh
set -e
mkdir -p lib
echo "Fetching Clojure..."
curl -O -s http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/clojure-1.5.1.zip
unzip -qu clojure-1.5.1.zip
echo "Copying clojure-1.5.1/clojure-1.5.1.jar to lib/clojure.jar..."
cp clojure-1.5.1/clojure-1.5.1.jar lib/clojure.jar
echo "Cleaning up Clojure directory..."
rm -rf clojure-1.5.1/
echo "Cleaning up Clojure archive..."
rm clojure-1.5.1.zip
echo "Fetching data.json..."
curl -O -s http://repo1.maven.org/maven2/org/clojure/data.json/0.2.2/data.json-0.2.2.jar
echo "Copying data.json-0.2.2.jar to lib/data.json-0.2.2.jar..."
cp data.json-0.2.2.jar lib/data.json-0.2.2.jar
echo "Cleaning up data.json..."
rm data.json-0.2.2.jar
echo "Fetching Google Closure library..."
mkdir -p closure/library
cd closure/library
if [ "$1" = "--closure-library-head" ] ; then
echo "Building against HEAD of Google Closure library..."
# Check if svn present
type svn >/dev/null 2>&1 || { echo >&2 "Need svn command to checkout HEAD of Google Closure library. Aborting."; exit 1; }
# Existing checkout?
if svn info --non-interactive >/dev/null 2>&1; then
echo "Updating Google Closure library from HEAD..."
svn update -q --non-interactive
else
echo "Checking out HEAD of Google Closure library..."
rm -rf *
svn checkout -q --non-interactive http://closure-library.googlecode.com/svn/trunk/ ./
fi
else
curl -O -s http://repo1.maven.org/maven2/org/clojure/google-closure-library/0.0-2029-2/google-closure-library-0.0-2029-2.jar
cp google-closure-library-0.0-2029-2.jar ../../lib/google-closure-library-0.0-2029-2.jar
rm google-closure-library-0.0-2029-2.jar
echo "Fetching Google Closure third party library..."
curl -O -s http://repo1.maven.org/maven2/org/clojure/google-closure-library-third-party/0.0-2029-2/google-closure-library-third-party-0.0-2029-2.jar
cp google-closure-library-third-party-0.0-2029-2.jar ../../lib/google-closure-library-third-party-0.0-2029-2.jar
rm google-closure-library-third-party-0.0-2029-2.jar
fi
cd ..
echo "Fetching Google Closure compiler..."
mkdir -p compiler
cd compiler
curl -O -s http://closure-compiler.googlecode.com/files/compiler-latest.zip
unzip -qu compiler-latest.zip
echo "Cleaning up Google Closure compiler archive..."
rm compiler-latest.zip
cd ../..
if [ "$1" = "--closure-library-head" ] ; then
echo "Building lib/goog.jar..."
echo "jar cf ./lib/goog.jar -C closure/library/closure/ goog"
jar cf ./lib/goog.jar -C closure/library/closure/ goog
fi
echo "Fetching Rhino..."
curl -O -s http://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R3.zip
unzip -qu rhino1_7R3.zip
echo "Copying rhino1_7R3/js.jar to lib/js.jar..."
cp rhino1_7R3/js.jar lib/js.jar
echo "Cleaning up Rhino directory..."
rm -rf rhino1_7R3/
echo "Cleaning up Rhino archive..."
rm rhino1_7R3.zip
echo "Copying closure/compiler/compiler.jar to lib/compiler.jar"
cp closure/compiler/compiler.jar lib
echo "[Bootstrap Completed]"