#!/bin/sh set -e mkdir -p lib echo "Fetching Clojure..." curl -O -s http://repo1.maven.org/maven2/org/clojure/clojure/1.4.0/clojure-1.4.0.zip unzip -qu clojure-1.4.0.zip echo "Copying clojure-1.4.0/clojure-1.4.0.jar to lib/clojure.jar..." cp clojure-1.4.0/clojure-1.4.0.jar lib/clojure.jar echo "Cleaning up Clojure directory..." rm -rf clojure-1.4.0/ echo "Cleaning up Clojure archive..." rm clojure-1.4.0.zip 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 echo "Fetching Google Closure library..." f=closure-library-20111110-r1376.zip curl -O -s "http://closure-library.googlecode.com/files/$f" unzip -qu "$f" echo "Cleaning up Google Closure library archive..." rm "$f" 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 ../.. 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 -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]"