Fix the local npm compiler build script (#2698)

The google closure compiler has moved the java compiler into it's own package under google-closure-compiler-java. Updating paths to reflect that.
This commit is contained in:
Sam El-Husseini
2019-07-24 11:08:54 -07:00
committed by GitHub
parent 2f7a42e3fa
commit 8d72f713a5
2 changed files with 11 additions and 8 deletions

View File

@@ -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 \

View File

@@ -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