flutter/dev/bots/test.sh
Ian Hickson 69d78325ec Licenses (#4984)
This makes the about page show the licenses of all the Dart packages that a Flutter app uses.

Issues that this does not yet resolve:
- I'm still working on getting the full list of licenses for the sky_engine package.
- Some of the licenses don't print very readably.
- There's no scrollbar on the license page.

I'll provide fixes for the first two in the coming days, but this should unblock anyone who is wanting to see something here, even if it's not quite complete. :-)

----

The patch makes the following changes: 

- The license registry is now asynchronous, since the data comes from disk.
- I moved the default license collector from the foundation package to the services package since it uses the default asset bundle now.
- The FLX builder now includes the LICENSE files of each Dart package mentioned in the `.packages` file.
2016-07-21 09:09:48 -07:00

58 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"
trap detect_error_on_exit EXIT HUP INT QUIT TERM
detect_error_on_exit() {
exit_code=$?
set +x
if [[ $exit_code -ne 0 ]]; then
echo -e "\x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\x1B[0m"
echo -e "\x1B[1mError:\x1B[31m script exited early due to error ($exit_code)\x1B[0m"
echo -e "\x1B[31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\x1B[0m"
fi
}
set -ex
# analyze all the Dart code in the repo
flutter analyze --flutter-repo
# verify that the tests actually return failure on failure and success on success
(cd dev/automated_tests; ! flutter test test_smoke_test/fail_test.dart > /dev/null)
(cd dev/automated_tests; flutter test test_smoke_test/pass_test.dart > /dev/null)
COVERAGE_FLAG=
if [ -n "$TRAVIS" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
COVERAGE_FLAG=--coverage
fi
# run tests
(cd packages/flutter; flutter test $COVERAGE_FLAG)
(cd packages/flutter_driver; dart -c test/all.dart)
(cd packages/flutter_sprites; flutter test)
(cd packages/flutter_test; flutter test)
(cd packages/flutter_tools; dart -c test/all.dart)
(cd dev/manual_tests; flutter test)
(cd examples/hello_world; flutter test)
(cd examples/layers; flutter test)
(cd examples/stocks; flutter test)
(cd examples/flutter_gallery; flutter test)
# generate and analyze our large sample app
dart dev/tools/mega_gallery.dart
(cd dev/benchmarks/mega_gallery; flutter analyze --watch --benchmark)
if [ -n "$COVERAGE_FLAG" ]; then
GSUTIL=$HOME/google-cloud-sdk/bin/gsutil
GCLOUD=$HOME/google-cloud-sdk/bin/gcloud
$GCLOUD auth activate-service-account --key-file ../gcloud_key_file.json
STORAGE_URL=gs://flutter_infra/flutter/coverage/lcov.info
$GSUTIL cp packages/flutter/coverage/lcov.info $STORAGE_URL
fi
# generate the API docs, upload them
dev/bots/docs.sh