-
Notifications
You must be signed in to change notification settings - Fork 790
/
Copy pathbootstrap
executable file
·116 lines (98 loc) · 6.13 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/sh
set -e
CLOJURE_RELEASE="1.9.0"
SPEC_ALPHA_RELEASE="0.1.143"
CORE_SPECS_ALPHA_RELEASE="0.1.24"
CLOSURE_RELEASE="20240317"
GCLOSURE_LIB_RELEASE="0.0-20230227-c7c0a541"
TREADER_RELEASE="1.3.6"
TEST_CHECK_RELEASE="1.1.1"
# check dependencies
curl -V >/dev/null || { echo "cURL is missing, or not on your system path."; exit 1; }
unzip -v >/dev/null || { echo "The 'unzip' utility is missing, or not on your system path."; exit 1; }
rm -rf lib
mkdir -p lib
echo "Fetching Clojure..."
curl -O -s https://repo1.maven.org/maven2/org/clojure/clojure/$CLOJURE_RELEASE/clojure-$CLOJURE_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Copying clojure-$CLOJURE_RELEASE.jar to lib/clojure.jar..."
cp clojure-$CLOJURE_RELEASE.jar lib/clojure.jar
echo "Cleaning up Clojure jar..."
rm clojure-$CLOJURE_RELEASE.jar
echo "Fetching specs.alpha...."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/spec.alpha/$SPEC_ALPHA_RELEASE/spec.alpha-$SPEC_ALPHA_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Copying spec.alpha-$SPEC_ALPHA_RELEASE/spec.alpha-$SPEC_ALPHA_RELEASE.jar to lib/spec.alpha.jar..."
cp spec.alpha-$SPEC_ALPHA_RELEASE.jar lib/spec.alpha-$SPEC_ALPHA_RELEASE.jar
echo "Cleaning up spec.alpha..."
rm spec.alpha-$SPEC_ALPHA_RELEASE.jar
echo "Fetching core.specs.alpha...."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/core.specs.alpha/$CORE_SPECS_ALPHA_RELEASE/core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Copying core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE/core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE.jar to lib/core.specs.alpha.jar..."
cp core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE.jar lib/core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE.jar
echo "Cleaning up core.specs.alpha..."
rm core.specs.alpha-$CORE_SPECS_ALPHA_RELEASE.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..."
# Existing checkout?
if [ -d closure-library ] ; then
echo "Updating Google Closure library from HEAD..."
cd closure-library
git pull
cd ..
else
echo "Checking out HEAD of Google Closure library..."
rm -rf *
git clone https://github.com/google/closure-library
fi
else
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/google-closure-library/$GCLOSURE_LIB_RELEASE/google-closure-library-$GCLOSURE_LIB_RELEASE.jar || { echo "Download failed."; exit 1; }
cp google-closure-library-$GCLOSURE_LIB_RELEASE.jar ../../lib/google-closure-library-$GCLOSURE_LIB_RELEASE.jar
rm google-closure-library-$GCLOSURE_LIB_RELEASE.jar
echo "Fetching Google Closure third party library..."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/google-closure-library-third-party/$GCLOSURE_LIB_RELEASE/google-closure-library-third-party-$GCLOSURE_LIB_RELEASE.jar || { echo "Download failed."; exit 1; }
cp google-closure-library-third-party-$GCLOSURE_LIB_RELEASE.jar ../../lib/google-closure-library-third-party-$GCLOSURE_LIB_RELEASE.jar
rm google-closure-library-third-party-$GCLOSURE_LIB_RELEASE.jar
fi
cd ../..
echo "Fetching Google Closure compiler..."
if [ "$1" = "--closure-compiler-snapshot" ] ; then
curl --retry 3 -O -s https://oss.sonatype.org/content/repositories/snapshots/com/google/javascript/closure-compiler/1.0-SNAPSHOT/maven-metadata.xml || { echo "Download failed."; exit 1; }
CC_JAR_VERSION=`grep value maven-metadata.xml | head -1 | awk -F '[<>]' '/value/{print $3}'`
CC_JAR_NAME=closure-compiler-$CC_JAR_VERSION.jar
curl --retry 3 -O -s https://oss.sonatype.org/content/repositories/snapshots/com/google/javascript/closure-compiler/1.0-SNAPSHOT/$CC_JAR_NAME || { echo "Download failed."; exit 1; }
cp $CC_JAR_NAME lib/$CC_JAR_NAME
echo "Cleaning up closure-compiler.jar..."
rm $CC_JAR_NAME
rm maven-metadata.xml
else
curl --retry 3 -O -s https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/v$CLOSURE_RELEASE/closure-compiler-v$CLOSURE_RELEASE.jar || { echo "Download failed."; exit 1; }
cp closure-compiler-v$CLOSURE_RELEASE.jar lib/closure-compiler-v$CLOSURE_RELEASE.jar
echo "Cleaning up closure-compiler.jar..."
rm closure-compiler-v$CLOSURE_RELEASE.jar
fi
if [ "$1" = "--closure-library-head" ] ; then
echo "Building lib/google-closure-library-HEAD.jar..."
# Set up the third-party deps paths to match what we would get when depending on a release
sed -e 's/..\/..\/third_party\/closure\/goog\///' closure/library/closure-library/closure/goog/deps.js > revised-deps.js
cp closure/library/closure-library/closure/goog/deps.js orig-deps.js
mv revised-deps.js closure/library/closure-library/closure/goog/deps.js
jar cf ./lib/google-closure-library-HEAD.jar -C closure/library/closure-library/closure/ goog
mv orig-deps.js closure/library/closure-library/closure/goog/deps.js
echo "Building lib/google-closure-library-third-party-HEAD.jar..."
mv closure/library/closure-library/third_party/closure/goog/deps.js orig-deps.js
mv closure/library/closure-library/third_party/closure/goog/base.js orig-base.js
jar cf ./lib/google-closure-library-third-party-HEAD.jar -C closure/library/closure-library/third_party/closure/ goog
mv orig-base.js closure/library/closure-library/third_party/closure/goog/base.js
mv orig-deps.js closure/library/closure-library/third_party/closure/goog/deps.js
fi
echo "Fetching tools.reader $TREADER_RELEASE ..."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/tools.reader/$TREADER_RELEASE/tools.reader-$TREADER_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Moving tools.reader.jar to lib/tools.reader.jar"
mv tools.reader-$TREADER_RELEASE.jar lib/tools.reader-$TREADER_RELEASE.jar
echo "Fetching test.check $TEST_CHECK_RELEASE ..."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/test.check/$TEST_CHECK_RELEASE/test.check-$TEST_CHECK_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Moving test.check.jar to lib/test.check.jar"
mv test.check-$TEST_CHECK_RELEASE.jar lib/test.check.jar
echo "[Bootstrap Completed]"