Mind renaming.
[dygraphs.git] / compile-with-closure.sh
index 96b2250..496a244 100755 (executable)
@@ -1,11 +1,28 @@
 #!/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.
+
+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 \
  --js=dashed-canvas.js \
- --js=dygraph-constants.js \
  --js=dygraph-options.js \
  --js=dygraph-layout.js \
  --js=dygraph-canvas.js \
@@ -31,6 +48,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