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
|
2018-03-23 10:55:32 -04:00
|
|
|
echo "./test.sh [node|browser|browserNoRouter|router] [--debug]"
|
|
|
|
echo "(--debug flag only relevant to 'node' 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
|
2016-11-23 17:23:05 -05:00
|
|
|
if [[ $1 == 'node' ]]; then
|
|
|
|
# Note: .metadata.json files are needed for the language service tests!
|
2017-09-20 12:54:47 -04:00
|
|
|
echo "Building compiler..."
|
|
|
|
$(npm bin)/tsc -p packages/compiler/tsconfig-tools.json
|
|
|
|
$(npm bin)/tsc -p packages/compiler-cli/tsconfig-tools.json
|
|
|
|
echo "Creating packages .metadata.json files..."
|
|
|
|
node --max-old-space-size=3000 dist/tools/@angular/compiler-cli/src/main -p packages/tsconfig-metadata.json
|
2016-11-23 17:23:05 -05:00
|
|
|
fi
|
2018-06-25 05:11:22 -04:00
|
|
|
node --harmony dist/tools/tsc-watch/ $1 watch $2
|
2016-06-14 16:06:16 -04:00
|
|
|
fi
|