X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=compile-with-closure.sh;h=90d9d9a30847fa64ce92c17db72cf497282d1f4a;hb=0a5aa490041ec62b5c7e4951d4d4e7a2fd345fc2;hp=496a2442f108697533fac2220ff6e5fbfeacedd3;hpb=e1242d5b540803a1848481ce75932a85693de74c;p=dygraphs.git diff --git a/compile-with-closure.sh b/compile-with-closure.sh index 496a244..90d9d9a 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -6,22 +6,18 @@ # It outputs minified JS to a temp file. This should be ignored for now, until # it's fully functional. -if [ $# -ne 1 ]; then - echo "Usage: $0 (path/to/closure/compiler.jar)" 1>&2 +CLOSURE_COMPILER=node_modules/closure-compiler/lib/vendor/compiler.jar +BASE_JS=node_modules/obvious-closure-library/closure/goog/base.js +if [[ (! -f $CLOSURE_COMPILER) || (! -f $BASE_JS) ]]; then + echo "Missing compiler.jar or base.js. Try running 'npm install'." 1>&2 exit 1 fi -if [ ! -f $1 ]; then - echo "$1 does not exist" - exit 1 -fi - -CLOSURE_COMPILER=$1 java -jar $CLOSURE_COMPILER \ --compilation_level ADVANCED_OPTIMIZATIONS \ --warning_level VERBOSE \ --output_wrapper='(function() {%output%})();' \ - --js ../../closure-library-read-only/closure/goog/base.js \ + --js $BASE_JS \ --js=dashed-canvas.js \ --js=dygraph-options.js \ --js=dygraph-layout.js \