2016-04-28 20:50:03 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e -o pipefail
|
|
|
|
|
2016-06-14 16:06:16 -04:00
|
|
|
if [ $# -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "Angular test runner. (No platform specified)"
|
|
|
|
echo
|
2017-08-31 17:06:22 -04:00
|
|
|
echo "./test.sh [node|browser|browserNoRouter|router|tools] [--debug]"
|
|
|
|
echo "(--debug flag only relevant to 'node' and 'tools' testing - see https://github.com/angular/angular/blob/master/docs/DEBUG.md)"
|
2016-06-14 16:06:16 -04:00
|
|
|
echo
|
|
|
|
else
|
|
|
|
cd `dirname $0`
|
2016-09-02 19:23:00 -04:00
|
|
|
rm -rf dist/tools
|
2016-08-26 18:41:50 -04:00
|
|
|
if [ -z ${NODE_PATH+x} ]; then
|
|
|
|
export NODE_PATH=$(pwd)/dist/all:$(pwd)/dist/tools
|
|
|
|
else
|
|
|
|
export NODE_PATH=$NODE_PATH:$(pwd)/dist/all/:$(pwd)/dist/tools/
|
|
|
|
fi
|
2016-11-23 17:23:05 -05:00
|
|
|
echo "Compiling tools..."
|
2016-06-14 16:06:16 -04:00
|
|
|
$(npm bin)/tsc -p tools
|
2017-07-16 13:47:46 -04:00
|
|
|
$(npm bin)/tsc -p packages/tsc-wrapped
|
2016-11-23 17:23:05 -05:00
|
|
|
if [[ $1 == 'node' ]]; then
|
|
|
|
# Note: .metadata.json files are needed for the language service tests!
|
|
|
|
echo "Creating .metadata.json files..."
|
2017-08-16 10:10:17 -04:00
|
|
|
node --max-old-space-size=3000 dist/all/@angular/tsc-wrapped/src/main -p packages
|
|
|
|
node --max-old-space-size=3000 dist/all/@angular/tsc-wrapped/src/main -p modules
|
2016-11-23 17:23:05 -05:00
|
|
|
fi
|
2017-08-31 17:06:22 -04:00
|
|
|
node dist/tools/tsc-watch/ $1 watch $2
|
2016-06-14 16:06:16 -04:00
|
|
|
fi
|