X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=compile-with-closure.sh;h=496a2442f108697533fac2220ff6e5fbfeacedd3;hb=bacf5ce283d6871ce1c090f29bf5411341622248;hp=d39e5d00fceb679f14aae877ea5038c622bd5d23;hpb=faa608cf1a12c03d9cc0d23e3583ce9e0919558f;p=dygraphs.git diff --git a/compile-with-closure.sh b/compile-with-closure.sh index d39e5d0..496a244 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -1,6 +1,24 @@ #!/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. + +if [ $# -ne 1 ]; then + echo "Usage: $0 (path/to/closure/compiler.jar)" 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 \ @@ -33,5 +51,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 \