From 23b37ee41fc270e25ed30954108f87ed506117fb Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 23 Jun 2014 23:57:25 -0400 Subject: [PATCH] Use closure compiler from NPM --- compile-with-closure.sh | 14 +++++--------- package.json | 4 +++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/compile-with-closure.sh b/compile-with-closure.sh index 496a244..90d9d9a 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -6,22 +6,18 @@ # 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 +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 -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 $BASE_JS \ --js=dashed-canvas.js \ --js=dygraph-options.js \ --js=dygraph-layout.js \ diff --git a/package.json b/package.json index e62960c..92823a4 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ }, "homepage": "https://github.com/danvk/dygraphs", "devDependencies": { - "phantomjs": "^1.9.7-8" + "phantomjs": "^1.9.7-8", + "closure-compiler": "^0.2.6", + "obvious-closure-library": "^20140401.0.2" }, "scripts": { "test": "make test" -- 2.7.4