Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 101 lines (82 sloc) 4.33 KB
set -e
# 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; }
mkdir -p lib
echo "Fetching Clojure..."
curl -O -s$CLOJURE_RELEASE/clojure-$ || { echo "Download failed."; exit 1; }
unzip -qu clojure-$
echo "Copying clojure-$CLOJURE_RELEASE/clojure-$CLOJURE_RELEASE.jar to lib/clojure.jar..."
cp clojure-$CLOJURE_RELEASE/clojure-$CLOJURE_RELEASE.jar lib/clojure.jar
echo "Cleaning up Clojure directory..."
rm -rf clojure-$CLOJURE_RELEASE/
echo "Cleaning up Clojure archive..."
rm clojure-$
echo "Fetching data.json..."
curl --retry 3 -O -s$DJSON_RELEASE/data.json-$DJSON_RELEASE.jar || { echo "Download failed."; exit 1; }
echo "Copying data.json-$DJSON_RELEASE.jar to lib/data.json-$DJSON_RELEASE.jar..."
cp data.json-$DJSON_RELEASE.jar lib/data.json-$DJSON_RELEASE.jar
echo "Cleaning up data.json..."
rm data.json-$DJSON_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..."
# 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
echo "Checking out HEAD of Google Closure library..."
rm -rf *
svn checkout -q --non-interactive ./
curl --retry 3 -O -s$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$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
cd ..
echo "Fetching Google Closure compiler..."
mkdir -p compiler
cd compiler
curl --retry 3 -O -s$ || { echo "Download failed."; exit 1; }
unzip -qu compiler-$
echo "Cleaning up Google Closure compiler archive..."
rm compiler-$
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
echo "Fetching Rhino..."
curl --retry 3 -LOk -s${RHINO_RELEASE}_RELEASE/rhino$ || { echo "Download failed."; exit 1; }
unzip -qu rhino$
echo "Copying rhino$RHINO_RELEASE/js.jar to lib/js.jar..."
cp rhino$RHINO_RELEASE/js.jar lib/js.jar
echo "Cleaning up Rhino directory..."
rm -rf rhino$RHINO_RELEASE/
echo "Cleaning up Rhino archive..."
rm rhino$
echo "Copying closure/compiler/compiler.jar to lib/compiler.jar"
cp closure/compiler/compiler.jar lib
echo "Fetching tools.reader $TREADER_RELEASE ..."
curl --retry 3 -O -s$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 "[Bootstrap Completed]"
Something went wrong with that request. Please try again.