Merge pull request #309 from hulkholden/hidpi
[dygraphs.git] / compile-with-closure.sh
index 50a93f2..90d9d9a 100755 (executable)
@@ -6,11 +6,18 @@
 # It outputs minified JS to a temp file. This should be ignored for now, until
 # it's fully functional.
 
-java -jar ../../closure-compiler-read-only/build/compiler.jar  \
+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 \