X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=compile-with-closure.sh;h=90d9d9a30847fa64ce92c17db72cf497282d1f4a;hb=99386b99835dfcc75053b4a9a4304b3d8a8546ad;hp=d39e5d00fceb679f14aae877ea5038c622bd5d23;hpb=30e697bb3cd120dbbc64818d1ed9921a6771e956;p=dygraphs.git diff --git a/compile-with-closure.sh b/compile-with-closure.sh index d39e5d0..90d9d9a 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -1,9 +1,23 @@ #!/bin/bash -java -jar ../../closure-compiler-read-only/build/compiler.jar \ - --compilation_level SIMPLE_OPTIMIZATIONS \ + +# This script runs dygraphs through the Closure Compiler. This checks for +# errors (both in the JS and in the jsdoc) and flags type errors as WARNINGS. + +# It outputs minified JS to a temp file. This should be ignored for now, until +# it's fully functional. + +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 + +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 \ @@ -33,5 +47,3 @@ java -jar ../../closure-compiler-read-only/build/compiler.jar \ --externs dygraph-internal.externs.js \ --externs gviz-api.js \ --js_output_file=/tmp/out.js - -# --js=dygraph-constants.js \