chore: remove obsolete files (#10240)
This commit is contained in:
@ -61,6 +61,4 @@ $(npm bin)/webdriver-manager update
|
||||
# TODO: install bower packages
|
||||
# bower install
|
||||
|
||||
# TODO: install dart packages
|
||||
|
||||
echo 'travis_fold:end:INSTALL'
|
||||
|
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
echo =============================================================================
|
||||
# go to project dir
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
source $SCRIPT_DIR/env_dart.sh
|
||||
cd $SCRIPT_DIR/../..
|
||||
|
||||
./node_modules/.bin/gulp build.js.cjs build.dart benchpress.bundle
|
||||
|
||||
pub install
|
@ -1,170 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
echo =============================================================================
|
||||
echo "DART DEV COMPILER (DDC) BUILD"
|
||||
echo =============================================================================
|
||||
|
||||
# go to project dir
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
REPO_ROOT_DIR=`cd ${SCRIPT_DIR}/../..; pwd`
|
||||
source $SCRIPT_DIR/env_dart.sh
|
||||
cd $REPO_ROOT_DIR
|
||||
|
||||
# Variables
|
||||
DDC_TOTAL_WARNING_CAP="100"
|
||||
DDC_TOTAL_ERROR_CAP="0"
|
||||
DDC_DIR=`pwd`/tmp/dev_compiler
|
||||
DDC_VERSION="0.1.24"
|
||||
|
||||
# Get DDC
|
||||
mkdir -p tmp
|
||||
rm -rf tmp/dev_compiler
|
||||
git clone https://github.com/dart-lang/dev_compiler.git tmp/dev_compiler
|
||||
(cd $DDC_DIR && \
|
||||
git checkout tags/$DDC_VERSION && \
|
||||
$PUB get)
|
||||
|
||||
# Convert TypeScript to Dart
|
||||
./node_modules/.bin/gulp build.js.cjs
|
||||
./node_modules/.bin/gulp build/packages.dart
|
||||
./node_modules/.bin/gulp build/pubspec.dart
|
||||
node ./scripts/ci/dart_ddc/pubspec_for_ddc.js \
|
||||
--pubspec-file=dist/dart/playground/pubspec.yaml
|
||||
cd dist/dart/playground
|
||||
$PUB build --mode=debug
|
||||
cd build/web
|
||||
|
||||
# TODO: temporarily remove references to dart.js as ddc doesn't do it
|
||||
# automatically yet (https://github.com/dart-lang/dev_compiler/issues/437)
|
||||
echo `pwd`
|
||||
for htmlFile in `find ./src -name '*.html'`; do
|
||||
tmpFile=$REPO_ROOT_DIR/tmp/scriptless_html.tmp
|
||||
cat $htmlFile | grep -vE '<script.*dart\.js' >$tmpFile
|
||||
mv $tmpFile $htmlFile
|
||||
done
|
||||
|
||||
##############################################################################
|
||||
# Analyze code
|
||||
##############################################################################
|
||||
|
||||
LOG_FILE="analyzer.log"
|
||||
set +e
|
||||
$DART_SDK/bin/dart $DDC_DIR/bin/dartdevc.dart \
|
||||
--dart-sdk=$DART_SDK_LIB_SEARCH_PATH -o out \
|
||||
src/animate/index.dart \
|
||||
src/async/index.dart \
|
||||
src/gestures/index.dart \
|
||||
src/hash_routing/index.dart \
|
||||
src/hello_world/index.dart \
|
||||
src/key_events/index.dart \
|
||||
src/model_driven_forms/index.dart \
|
||||
src/observable_models/index.dart \
|
||||
src/order_management/index.dart \
|
||||
src/person_management/index.dart \
|
||||
src/relative_assets/index.dart \
|
||||
src/routing/index.dart \
|
||||
src/sourcemap/index.dart \
|
||||
src/svg/index.dart \
|
||||
src/template_driven_forms/index.dart \
|
||||
src/todo/index.dart \
|
||||
src/zippy_component/index.dart \
|
||||
>$LOG_FILE
|
||||
EXIT_CODE=`echo $?`
|
||||
set -e
|
||||
|
||||
# Analyzer exits with 1 when there are warnings and something crazy
|
||||
# like 255 when it crashes. We don't want to fail the build if its
|
||||
# only warnings (until our code is warning-free).
|
||||
if [[ "$EXIT_CODE" -ne "0" && "$EXIT_CODE" -ne "1" ]]
|
||||
then
|
||||
echo "DDC compiler crashed with exit code $EXIT_CODE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat $LOG_FILE
|
||||
EXIT_CODE=0
|
||||
|
||||
# TODO remove `grep -v template.dart` after Tobias new compiler lands.
|
||||
|
||||
WARNING_COUNT=$(cat $LOG_FILE | grep -E '^warning.*' | wc -l | sed -e 's/^[[:space:]]*//' || true)
|
||||
ERROR_COUNT=$(cat $LOG_FILE | grep -E '^severe.*' | wc -l | sed -e 's/^[[:space:]]*//' || true)
|
||||
|
||||
|
||||
if [[ "$ERROR_COUNT" -gt "$DDC_TOTAL_ERROR_CAP" ]]
|
||||
then
|
||||
echo "Found severe errors in angular2 package"
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
||||
if [[ "$WARNING_COUNT" -gt "$DDC_TOTAL_WARNING_CAP" ]]
|
||||
then
|
||||
echo "Too many warnings: $WARNING_COUNT"
|
||||
EXIT_CODE=1
|
||||
else
|
||||
echo "Warning count ok"
|
||||
fi
|
||||
|
||||
|
||||
##############################################################################
|
||||
# Run e2e tests
|
||||
##############################################################################
|
||||
|
||||
DIST_DIR="${REPO_ROOT_DIR}/dist/js/ddc"
|
||||
|
||||
# Build the apps (again)
|
||||
# TODO: ddc does not yet support compiling multiple html files. Ideally we
|
||||
# could build everything during analysis above.
|
||||
# See: https://github.com/dart-lang/dev_compiler/issues/430
|
||||
|
||||
ln -s `pwd`/packages src/hello_world/packages
|
||||
|
||||
set +e
|
||||
OUT_DIR="${DIST_DIR}/playground/src/hello_world"
|
||||
mkdir -p $OUT_DIR
|
||||
$DART_SDK/bin/dart $DDC_DIR/bin/dartdevc.dart \
|
||||
--force-compile \
|
||||
--dart-sdk=$DART_SDK_LIB_SEARCH_PATH -o $OUT_DIR \
|
||||
src/hello_world/index.html
|
||||
EXIT_CODE=`echo $?`
|
||||
set -e
|
||||
|
||||
if [[ "$EXIT_CODE" -ne "0" && "$EXIT_CODE" -ne "1" ]]
|
||||
then
|
||||
echo "DDC compiler crashed with exit code $EXIT_CODE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Run e2e tests
|
||||
cd $REPO_ROOT_DIR
|
||||
|
||||
./node_modules/.bin/webdriver-manager update
|
||||
|
||||
function killServer () {
|
||||
kill $serverPid
|
||||
}
|
||||
|
||||
./node_modules/.bin/gulp serve.js.ddc&
|
||||
serverPid=$!
|
||||
|
||||
echo CHROM_BIN=$CHROME_BIN
|
||||
echo CHROM_BIN_VERSION=`$CHROME_BIN --version`
|
||||
|
||||
trap killServer EXIT
|
||||
|
||||
# wait for server to come up
|
||||
sleep 10
|
||||
|
||||
function runSpec {
|
||||
SPEC=$1
|
||||
./node_modules/.bin/protractor protractor-ddc.conf.js \
|
||||
--browsers=${E2E_BROWSERS:-ChromeDesktop} \
|
||||
--spec=$SPEC
|
||||
}
|
||||
|
||||
# TODO: add more e2e tests
|
||||
runSpec hello_world/hello_world_spec.js
|
||||
|
||||
echo 'Dart DDC build finished'
|
||||
exit $EXIT_CODE
|
@ -1,25 +0,0 @@
|
||||
// Removes dart2js from pubspec.yaml for faster building
|
||||
// Usage: node pubspec_for_ddc.js --pubspec-file=PATH_TO_PUBSPEC_YAML
|
||||
|
||||
var fs = require('fs');
|
||||
var yaml = require('js-yaml');
|
||||
var yargs = require('yargs');
|
||||
|
||||
var pubspecFileOpt = 'pubspec-file';
|
||||
var pubspecFile = yargs
|
||||
.demand([pubspecFileOpt])
|
||||
.argv[pubspecFileOpt];
|
||||
|
||||
var doc = yaml.safeLoad(fs.readFileSync(pubspecFile, 'utf8'));
|
||||
|
||||
var transformers = doc['transformers'];
|
||||
if (transformers) {
|
||||
transformers.forEach(function (transformer) {
|
||||
var dart2js = transformer['\$dart2js'];
|
||||
if (dart2js) {
|
||||
dart2js['$exclude'] = [ 'web/**/*' ];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fs.writeFileSync(pubspecFile, yaml.safeDump(doc));
|
@ -1,101 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e -o pipefail
|
||||
|
||||
if [[ -z $ENV_SET ]]; then
|
||||
export ENV_SET=1
|
||||
|
||||
# Map DART_SDK and DARTSDK to each other if only one is specified.
|
||||
#
|
||||
# TODO(chirayu): Remove this legacy DARTSDK variable support. Check with Misko
|
||||
# to see if he's using it on this Mac.
|
||||
if [[ -z "$DART_SDK" ]]; then
|
||||
: "${DARTSDK:=$DART_SDK}"
|
||||
else
|
||||
: "${DART_SDK:=$DARTSDK}"
|
||||
fi
|
||||
|
||||
unset DART
|
||||
PLATFORM="$(uname -s)"
|
||||
|
||||
case "$PLATFORM" in
|
||||
(Darwin)
|
||||
path=$(readlink ${BASH_SOURCE[0]}||echo './scripts/env.sh')
|
||||
export NGDART_SCRIPT_DIR=$(dirname $path)
|
||||
;;
|
||||
(Linux)
|
||||
export NGDART_SCRIPT_DIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
|
||||
;;
|
||||
(*)
|
||||
echo Unsupported platform $PLATFORM. Exiting ... >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
export NGDART_BASE_DIR=$(dirname $NGDART_SCRIPT_DIR)
|
||||
|
||||
# Try to find the SDK alongside the dart command first.
|
||||
if [[ -z "$DART_SDK" ]]; then
|
||||
DART=$(which dart) || true
|
||||
if [[ -x "$DART" ]]; then
|
||||
DART_SDK="${DART/dart-sdk\/*/dart-sdk}"
|
||||
if [[ ! -e "$DART_SDK" ]]; then
|
||||
unset DART DART_SDK
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
# Fallback: Assume it's alongside the current directory (e.g. Travis).
|
||||
if [[ -z "$DART_SDK" ]]; then
|
||||
DART_SDK="$(pwd)/dart-sdk"
|
||||
fi
|
||||
|
||||
: "${DART:=$DART_SDK/bin/dart}"
|
||||
|
||||
if [[ ! -x "$DART" ]]; then
|
||||
echo Unable to locate the dart binary / SDK. Exiting >&2
|
||||
exit 3
|
||||
fi
|
||||
|
||||
if [[ -z "$DARTIUM" ]]; then
|
||||
dartiumRoot="$DART_SDK/../chromium"
|
||||
if [[ -e "$dartiumRoot" ]]; then
|
||||
case "$PLATFORM" in
|
||||
(Linux) export DARTIUM="$dartiumRoot/chrome" ;;
|
||||
(Darwin) export DARTIUM="$dartiumRoot/Chromium.app/Contents/MacOS/Chromium" ;;
|
||||
(*) echo Unsupported platform $PLATFORM. Exiting ... >&2 ; exit 3 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
|
||||
export DART_SDK_LIB_SEARCH_PATH="$DART_SDK"
|
||||
export DART_SDK
|
||||
export DARTSDK
|
||||
export DART
|
||||
export PUB=${PUB:-"$DART_SDK/bin/pub"}
|
||||
if [ -z "$PUB_CACHE" ]; then
|
||||
export PUB_CACHE=$DART_SDK/pub-cache
|
||||
fi
|
||||
export DARTANALYZER=${DARTANALYZER:-"$DART_SDK/bin/dartanalyzer"}
|
||||
export DARTDOC=${DARTDOC:-"$DART_SDK/bin/dartdoc"}
|
||||
export DART_DOCGEN=${DART_DOCGEN:-"$DART_SDK/bin/docgen"}
|
||||
export DART_VM_OPTIONS="--old_gen_heap_size=2048"
|
||||
export DARTIUM_BIN=${DARTIUM_BIN:-"$DARTIUM"}
|
||||
export CHROME_BIN=${CHROME_BIN:-"google-chrome"}
|
||||
export PATH=$PATH:$DART_SDK/bin
|
||||
|
||||
echo '*********'
|
||||
echo '** ENV **'
|
||||
echo '*********'
|
||||
echo DART_SDK=$DART_SDK
|
||||
echo DART_SDK_LIB_SEARCH_PATH=$DART_SDK_LIB_SEARCH_PATH
|
||||
echo DART=$DART
|
||||
echo PUB=$PUB
|
||||
echo DARTANALYZER=$DARTANALYZER
|
||||
echo DARTDOC=$DARTDOC
|
||||
echo DART_DOCGEN=$DART_DOCGEN
|
||||
echo DARTIUM_BIN=$DARTIUM_BIN
|
||||
echo CHROME_BIN=$CHROME_BIN
|
||||
echo PATH=$PATH
|
||||
echo NGDART_BASE_DIR=$NGDART_BASE_DIR
|
||||
echo NGDART_SCRIPT_DIR=$NGDART_SCRIPT_DIR
|
||||
|
||||
fi
|
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e -x
|
||||
|
||||
DART_CHANNEL=$1
|
||||
VERSION=$2
|
||||
ARCH=$3
|
||||
|
||||
AVAILABLE_DART_VERSION=$(curl "https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/${VERSION}/VERSION" | python -c \
|
||||
'import sys, json; print(json.loads(sys.stdin.read())["version"])')
|
||||
|
||||
echo Fetch Dart channel: ${DART_CHANNEL}
|
||||
|
||||
URL_PREFIX=https://storage.googleapis.com/dart-archive/channels/${DART_CHANNEL}/release/${VERSION}
|
||||
DART_SDK_URL="$URL_PREFIX/sdk/dartsdk-$ARCH-release.zip"
|
||||
DARTIUM_URL="$URL_PREFIX/dartium/dartium-$ARCH-release.zip"
|
||||
|
||||
download_and_unzip() {
|
||||
ZIPFILE=${1/*\//}
|
||||
curl -O -L $1 && unzip -q $ZIPFILE && rm $ZIPFILE
|
||||
}
|
||||
|
||||
# TODO: do these downloads in parallel
|
||||
download_and_unzip $DART_SDK_URL
|
||||
download_and_unzip $DARTIUM_URL
|
||||
|
||||
echo Fetched new dart version $(<dart-sdk/version)
|
||||
|
||||
if [[ -n $DARTIUM_URL ]]; then
|
||||
mv dartium-* chromium
|
||||
fi
|
@ -1,12 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
echo =============================================================================
|
||||
# go to project dir
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
source $SCRIPT_DIR/env_dart.sh
|
||||
cd $SCRIPT_DIR/../..
|
||||
|
||||
./node_modules/.bin/gulp test.dart --browsers=$KARMA_DART_BROWSERS
|
||||
${SCRIPT_DIR}/test_server_dart.sh
|
||||
${SCRIPT_DIR}/test_e2e_dart.sh
|
@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
echo =============================================================================
|
||||
# go to project dir
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
cd $SCRIPT_DIR/../..
|
||||
|
||||
./node_modules/.bin/webdriver-manager update
|
||||
|
||||
function killServer () {
|
||||
kill $serverPid
|
||||
}
|
||||
|
||||
# Serving pre-compiled dart JS takes an extra 15m.
|
||||
# So we do this only for post-commit testing.
|
||||
# Pull requests test with Dartium and pub serve
|
||||
# TODO(jeffbcross): restore conditional dart2js/pubserve #4316
|
||||
#if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
||||
# WARNING: the build/pubbuild.dart task is assumed to have been run before, in test_server_dart.sh
|
||||
./node_modules/.bin/gulp serve.js.dart2js&
|
||||
serverPid=$!
|
||||
#else
|
||||
# ./node_modules/.bin/gulp serve.dart&
|
||||
# serverPid=$!
|
||||
#fi
|
||||
|
||||
trap killServer EXIT
|
||||
|
||||
# wait for server to come up!
|
||||
sleep 10
|
||||
|
||||
./node_modules/.bin/protractor protractor-dart2js.conf.js --browsers=${E2E_BROWSERS:-Dartium}
|
||||
./node_modules/.bin/protractor protractor-dart2js.conf.js --benchmark --dryrun --browsers=${E2E_BROWSERS:-Dartium}
|
@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
echo =============================================================================
|
||||
# go to project dir
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
cd $SCRIPT_DIR/../..
|
||||
|
||||
./node_modules/.bin/webdriver-manager update
|
||||
./node_modules/.bin/webdriver-manager start&
|
||||
webdriverServerPid=$!
|
||||
ps -ef | grep webdriver-manager
|
||||
|
||||
# Serving pre-compiled dart JS takes an extra 15m.
|
||||
# So we do this only for post-commit testing.
|
||||
# Pull requests test with Dartium and pub serve
|
||||
# TODO(jeffbcross): restore conditional dart2js/pubserve #4316
|
||||
#if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
||||
./node_modules/.bin/gulp build/pubbuild.dart
|
||||
./node_modules/.bin/gulp serve.js.dart2js&
|
||||
serverPid=$!
|
||||
#else
|
||||
# ./node_modules/.bin/gulp serve.dart&
|
||||
# serverPid=$!
|
||||
#fi
|
||||
|
||||
function killAllServers () {
|
||||
kill $serverPid
|
||||
pkill -P $webdriverServerPid
|
||||
}
|
||||
|
||||
trap killAllServers EXIT
|
||||
|
||||
# wait for server to come up!
|
||||
sleep 3
|
||||
|
||||
./node_modules/.bin/gulp test.transpiler.unittest
|
||||
./node_modules/.bin/gulp test.server.dart --browsers=$KARMA_DART_BROWSERS
|
@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script prepares build artifacts for upload to pub.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# scripts/publish/pub_prepare.sh PACKAGE_NAME
|
||||
|
||||
set -ex
|
||||
shopt -s extglob
|
||||
|
||||
NAME=$1
|
||||
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
|
||||
cd $ROOT_DIR
|
||||
|
||||
PKG_DIR=$ROOT_DIR/dist/pub
|
||||
FILES='!(e2e_test|pubspec.lock)'
|
||||
|
||||
PUBLISH_DIR=$PKG_DIR/$NAME
|
||||
rm -fr $PUBLISH_DIR
|
||||
mkdir -p $PUBLISH_DIR
|
||||
|
||||
cp -RP $ROOT_DIR/dist/dart/$NAME/$FILES $PUBLISH_DIR
|
||||
|
||||
node scripts/publish/pubspec_cleaner.js --pubspec-file=$PUBLISH_DIR/pubspec.yaml
|
@ -1,38 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Publishes Angular 2 packages to pub.
|
||||
|
||||
set -ex
|
||||
shopt -s extglob
|
||||
|
||||
DRY_RUN=false
|
||||
if [[ $1 == '--dry_run' ]]; then
|
||||
DRY_RUN=true
|
||||
fi;
|
||||
|
||||
ROOT_DIR=$(cd $(dirname $0)/../..; pwd)
|
||||
cd $ROOT_DIR
|
||||
|
||||
gulp clean
|
||||
gulp build/packages.dart
|
||||
gulp build/pubspec.dart
|
||||
gulp build/analyze.dart
|
||||
|
||||
PKG_DIR=$ROOT_DIR/dist/pub
|
||||
rm -fr $PKG_DIR
|
||||
|
||||
function publishModule {
|
||||
NAME=$1
|
||||
PUBLISH_DIR=$PKG_DIR/$NAME
|
||||
|
||||
scripts/publish/pub_prepare.sh $NAME
|
||||
|
||||
if [[ "$DRY_RUN" == "false" ]]; then
|
||||
(cd $PUBLISH_DIR && pub publish -f)
|
||||
fi;
|
||||
}
|
||||
|
||||
publishModule angular2
|
||||
publishModule benchpress
|
||||
publishModule benchmarks
|
||||
publishModule angular2_testing
|
@ -1,35 +0,0 @@
|
||||
// Cleans up pubspec.yaml files prior to publishing
|
||||
// Usage: node pubspec_cleaner.js --pubspec-file=PATH_TO_PUBSPEC_YAML
|
||||
|
||||
fs = require('fs');
|
||||
yaml = require('js-yaml');
|
||||
yargs = require('yargs');
|
||||
|
||||
var pubspecFileOpt = 'pubspec-file';
|
||||
var pubspecFile = yargs
|
||||
.demand([pubspecFileOpt])
|
||||
.argv[pubspecFileOpt];
|
||||
|
||||
var doc = yaml.safeLoad(fs.readFileSync(pubspecFile, 'utf8'));
|
||||
|
||||
// Pub does not allow publishing with dependency_overrides
|
||||
delete doc['dependency_overrides'];
|
||||
|
||||
// Overwrite temporary values with real values
|
||||
delete doc['version'];
|
||||
delete doc['authors'];
|
||||
delete doc['homepage']
|
||||
|
||||
var BASE_PACKAGE_JSON = require('../../package.json');
|
||||
doc['version'] = BASE_PACKAGE_JSON.version;
|
||||
doc['homepage'] = BASE_PACKAGE_JSON.homepage;
|
||||
doc['authors'] = Object.keys(BASE_PACKAGE_JSON.contributors).map(function(name) {
|
||||
return BASE_PACKAGE_JSON.contributors[name];
|
||||
});
|
||||
|
||||
if (doc['dependencies'] && doc['dependencies']['angular2']) {
|
||||
delete doc['dependencies']['angular2'];
|
||||
doc['dependencies']['angular2'] = BASE_PACKAGE_JSON.version;
|
||||
}
|
||||
|
||||
fs.writeFileSync(pubspecFile, yaml.safeDump(doc));
|
Reference in New Issue
Block a user