| 1 | #!/bin/bash |
| 2 | |
| 3 | # This script runs dygraphs through the Closure Compiler. This checks for |
| 4 | # errors (both in the JS and in the jsdoc) and flags type errors as WARNINGS. |
| 5 | |
| 6 | # It outputs minified JS to a temp file. This should be ignored for now, until |
| 7 | # it's fully functional. |
| 8 | |
| 9 | if [ $# -ne 1 ]; then |
| 10 | echo "Usage: $0 (path/to/closure/compiler.jar)" 1>&2 |
| 11 | exit 1 |
| 12 | fi |
| 13 | if [ ! -f $1 ]; then |
| 14 | echo "$1 does not exist" |
| 15 | exit 1 |
| 16 | fi |
| 17 | |
| 18 | CLOSURE_COMPILER=$1 |
| 19 | |
| 20 | java -jar $CLOSURE_COMPILER \ |
| 21 | --compilation_level ADVANCED_OPTIMIZATIONS \ |
| 22 | --warning_level VERBOSE \ |
| 23 | --output_wrapper='(function() {%output%})();' \ |
| 24 | --js ../../closure-library-read-only/closure/goog/base.js \ |
| 25 | --js=dashed-canvas.js \ |
| 26 | --js=dygraph-options.js \ |
| 27 | --js=dygraph-layout.js \ |
| 28 | --js=dygraph-canvas.js \ |
| 29 | --js=dygraph.js \ |
| 30 | --js=dygraph-utils.js \ |
| 31 | --js=dygraph-gviz.js \ |
| 32 | --js=dygraph-interaction-model.js \ |
| 33 | --js=dygraph-tickers.js \ |
| 34 | --js=dygraph-plugin-base.js \ |
| 35 | --js=plugins/annotations.js \ |
| 36 | --js=plugins/axes.js \ |
| 37 | --js=plugins/chart-labels.js \ |
| 38 | --js=plugins/grid.js \ |
| 39 | --js=plugins/legend.js \ |
| 40 | --js=plugins/range-selector.js \ |
| 41 | --js=dygraph-plugin-install.js \ |
| 42 | --js=dygraph-options-reference.js \ |
| 43 | --js=datahandler/datahandler.js \ |
| 44 | --js=datahandler/default.js \ |
| 45 | --js=datahandler/default-fractions.js \ |
| 46 | --js=datahandler/bars.js \ |
| 47 | --js=datahandler/bars-custom.js \ |
| 48 | --js=datahandler/bars-error.js \ |
| 49 | --js=datahandler/bars-fractions.js \ |
| 50 | --js=dygraph-exports.js \ |
| 51 | --externs dygraph-internal.externs.js \ |
| 52 | --externs gviz-api.js \ |
| 53 | --js_output_file=/tmp/out.js |