2019-05-31 11:56:07 -04:00
|
|
|
# compile closure test source file
|
|
|
|
$(npm bin)/tsc -p .
|
|
|
|
# Run the Google Closure compiler java runnable with zone externs
|
2020-10-03 23:31:14 -04:00
|
|
|
java -jar ./node_modules/google-closure-compiler-java/compiler.jar --flagfile './scripts/closure/closure_flagfile' --externs './lib/closure/zone_externs.js' --externs './node_modules/@externs/nodejs/v8/global.js' --process_common_js_modules
|
2019-05-31 11:56:07 -04:00
|
|
|
|
|
|
|
# the names of Zone exposed API should be kept correctly with zone externs, test program should exit with 0.
|
2020-10-03 23:31:14 -04:00
|
|
|
node build/closure/zone-closure-bundle.js
|
2019-05-31 11:56:07 -04:00
|
|
|
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "Successfully pass closure compiler with zone externs"
|
|
|
|
else
|
|
|
|
echo "failed to pass closure compiler with zone externs"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run the Google Closure compiler java runnable without zone externs.
|
2020-10-03 23:31:14 -04:00
|
|
|
java -jar node_modules/google-closure-compiler-java/compiler.jar --flagfile 'scripts/closure/closure_flagfile' --externs './node_modules/@externs/nodejs/v8/global.js' --process_common_js_modules
|
2019-05-31 11:56:07 -04:00
|
|
|
|
2020-10-03 23:31:14 -04:00
|
|
|
node build/closure/zone-closure-bundle.js
|
2019-05-31 11:56:07 -04:00
|
|
|
|
|
|
|
if [ $? -eq 1 ]
|
|
|
|
then
|
|
|
|
echo "Successfully detect closure compiler error without zone externs"
|
|
|
|
else
|
|
|
|
echo "failed to detect closure compiler error without zone externs"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|