X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=compile-with-closure.sh;h=90d9d9a30847fa64ce92c17db72cf497282d1f4a;hb=25ca4e1c935157d4ab13aacd1b8dae327fa0b14e;hp=96b22506b69b8659ca63043991c1b1073714d6e5;hpb=badb74b312908d97379db0c5ca690df258a49063;p=dygraphs.git diff --git a/compile-with-closure.sh b/compile-with-closure.sh index 96b2250..90d9d9a 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -1,11 +1,24 @@ #!/bin/bash -java -jar ../../closure-compiler-read-only/build/compiler.jar \ + +# 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-constants.js \ --js=dygraph-options.js \ --js=dygraph-layout.js \ --js=dygraph-canvas.js \ @@ -31,6 +44,6 @@ java -jar ../../closure-compiler-read-only/build/compiler.jar \ --js=datahandler/bars-error.js \ --js=datahandler/bars-fractions.js \ --js=dygraph-exports.js \ - --externs dygraph-externs.js \ + --externs dygraph-internal.externs.js \ --externs gviz-api.js \ --js_output_file=/tmp/out.js