diff --git a/local_build/local_build.sh b/local_build/local_build.sh index 6dbfa935d..61a7bad80 100755 --- a/local_build/local_build.sh +++ b/local_build/local_build.sh @@ -51,10 +51,12 @@ if [[ ${PWD##*/} != $EXPECTED_PWD ]]; then fi # Find the Closure Compiler. -if [ -f "$(npm root)/google-closure-compiler/compiler.jar" ]; then - COMPILER="$(npm root)/google-closure-compiler/compiler.jar" +if [ -f "$(npm root)/google-closure-compiler-java/compiler.jar" ]; then + COMPILER="$(npm root)/google-closure-compiler-java/compiler.jar" + CLOSURE_LIBRARY="$(npm root)/google-closure-library" elif [ -f closure-compiler*.jar ]; then COMPILER="closure-compiler*.jar" + CLOSURE_LIBRARY="../../closure-library" # TODO: Check whether multiple files were found. else echo "ERROR: Closure Compiler not found." @@ -64,12 +66,13 @@ else fi echo Using $COMPILER as the compiler. +echo Using $CLOSURE_LIBRARY as the closure library. rm local_blockly_compressed.js 2> /dev/null echo Compiling Blockly core... java -jar $COMPILER \ --js='../core/**.js' \ - --js='../../closure-library/closure/goog/**.js' \ - --js='../../closure-library/third_party/closure/goog/**.js' \ + --js="$CLOSURE_LIBRARY/closure/goog/**.js" \ + --js="$CLOSURE_LIBRARY/third_party/closure/goog/**.js" \ --generate_exports \ --warning_level='DEFAULT' \ --compilation_level SIMPLE_OPTIMIZATIONS \ @@ -96,8 +99,8 @@ echo -e "'use strict';\ngoog.provide('Blockly');goog.provide('Blockly.Blocks');" cat ../blocks/*.js| grep -v "^'use strict';" >> temp.js java -jar $COMPILER \ --js='temp.js' \ - --js='../../closure-library/closure/goog/**.js' \ - --js='../../closure-library/third_party/closure/goog/**.js' \ + --js="$CLOSURE_LIBRARY/closure/goog/**.js" \ + --js="$CLOSURE_LIBRARY/third_party/closure/goog/**.js" \ --generate_exports \ --warning_level='DEFAULT' \ --compilation_level SIMPLE_OPTIMIZATIONS \ diff --git a/tests/compile/compile.sh b/tests/compile/compile.sh index f60c37cb1..77bf2db7f 100755 --- a/tests/compile/compile.sh +++ b/tests/compile/compile.sh @@ -23,8 +23,8 @@ fi # Find the Closure Compiler. if [ -n $NODE_MODULES ] && \ - [ -s $NODE_MODULES/google-closure-compiler/compiler.jar ]; then - COMPILER=$NODE_MODULES/google-closure-compiler/compiler.jar + [ -s $NODE_MODULES/google-closure-compiler-java/compiler.jar ]; then + COMPILER=$NODE_MODULES/google-closure-compiler-java/compiler.jar echo "Found npm google-closure-compiler:" echo " $COMPILER" npm list google-closure-compiler | grep google-closure-compiler