Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 101 lines (82 sloc) 4.33 KB
#!/bin/sh
set -e
CLOJURE_RELEASE="1.8.0"
CLOSURE_RELEASE="20160315"
DJSON_RELEASE="0.2.6"
GCLOSURE_LIB_RELEASE="0.0-20151016-61277aea"
RHINO_RELEASE="1_7R5"
TREADER_RELEASE="1.0.0-beta1"
# 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 https://repo1.maven.org/maven2/org/clojure/clojure/$CLOJURE_RELEASE/clojure-$CLOJURE_RELEASE.zip || { echo "Download failed."; exit 1; }
unzip -qu clojure-$CLOJURE_RELEASE.zip
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-$CLOJURE_RELEASE.zip
echo "Fetching data.json..."
curl --retry 3 -O -s https://repo1.maven.org/maven2/org/clojure/data.json/$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
else
echo "Checking out HEAD of Google Closure library..."
rm -rf *
svn checkout -q --non-interactive https://closure-library.googlecode.com/svn/trunk/ ./
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..."
mkdir -p compiler
cd compiler
curl --retry 3 -O -s https://dl.google.com/closure-compiler/compiler-$CLOSURE_RELEASE.zip || { echo "Download failed."; exit 1; }
unzip -qu compiler-$CLOSURE_RELEASE.zip
echo "Cleaning up Google Closure compiler archive..."
rm compiler-$CLOSURE_RELEASE.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 --retry 3 -LOk -s https://github.com/mozilla/rhino/releases/download/Rhino${RHINO_RELEASE}_RELEASE/rhino$RHINO_RELEASE.zip || { echo "Download failed."; exit 1; }
unzip -qu rhino$RHINO_RELEASE.zip
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$RHINO_RELEASE.zip
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 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 "[Bootstrap Completed]"
Something went wrong with that request. Please try again.