Chromium Code Reviews| Index: third_party/pkg/update_angular.sh |
| diff --git a/third_party/pkg/update_angular.sh b/third_party/pkg/update_angular.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..de44848b53fa7baaf276b6bf01e7d5056c1ba02a |
| --- /dev/null |
| +++ b/third_party/pkg/update_angular.sh |
| @@ -0,0 +1,73 @@ |
| +#!/bin/bash |
| +# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +# for details. All rights reserved. Use of this source code is governed by a |
| +# BSD-style license that can be found in the LICENSE file. |
| + |
| +# bail on error |
| +set -e |
| + |
| +DIR=$( cd $( dirname "${BASH_SOURCE[0]}" ) && pwd ) |
| +pushd $DIR > /dev/null |
| + |
| +echo "*** Deleting old version" |
| +rm -rf angular |
| + |
| +echo "*** Syncing code" |
| +git clone https://github.com/angular/angular.dart angular |
| + |
| +pushd angular > /dev/null |
| +REVISION=`git rev-parse HEAD` |
| +rm -rf .git |
| + |
| +echo "*** Generating test files" |
| +pushd test > /dev/null |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
nit: remove 1 space (test__>)
blois
2014/01/04 01:14:01
Done.
|
| + |
| +readonly TEST_FILES=$(find . -name "*_spec.dart" \ |
| + -not -path "./playback/*" \ |
| + -not -path "*/generated_parser_spec.dart") |
| +readonly OUT_DIR='../../../../pkg/third_party/angular_tests' |
| +rm -rf "${OUT_DIR}" |
| + |
| +for src_file in ${TEST_FILES}; do |
| + test_dir=$(dirname ${src_file}) |
| + mkdir -p "${OUT_DIR}/${test_dir:2}" |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
let's add a comment of why :2 (removing the ./ fro
blois
2014/01/04 01:14:01
Done.
|
| + out_file="${OUT_DIR}/${src_file:2}" |
| + out_file="${out_file%spec.dart}test.dart" |
| + dots=$(echo "$(dirname "${src_file}")/" | sed -e "s/[^\/]\+/../g") |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
since you already have $test_dir, use that instead
|
| + config_import="import 'package:unittest/html_config.dart';" |
| + configuration="useHtmlConfiguration();" |
| + if [[ "${src_file}}" =~ ./io/* ]]; then |
| + configuration="" |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
vm_config.dart / useVMConfiguration?
or even
compa
blois
2014/01/04 01:14:01
Done.
|
| + config_import="" |
| + fi |
| + |
| + cat << END_HEADER > ${out_file} |
| +/// auto-generated by generate_angular_tests.sh |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
'generate_angular_tests.sh' => 'third_party/pkg/up
blois
2014/01/04 01:14:01
Done.
|
| + |
| +// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
2014! nice :)
blois
2014/01/04 01:14:01
Done.
|
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +library angular_tests; |
| + |
| +import 'package:angular/mock/module.dart'; |
| +import 'package:unittest/unittest.dart'; |
| +${config_import} |
| +import '${dots}../../third_party/pkg/angular/test/${src_file:2}' as test_lib; |
| + |
| +main() { |
| + ${configuration} |
| + |
| + setUp(() { |
| + setUpInjector(); |
| + }); |
| + |
| + test_lib.main(); |
| +} |
| + |
| +END_HEADER |
| +done |
|
Siggi Cherem (dart-lang)
2014/01/03 22:21:13
consider adding indentation here to match the inde
blois
2014/01/04 01:14:01
Done.
|
| +popd |
| + |
| +echo "${REVISION}" >> REVISION |
| +echo "*** Updated to revision $REVISION" |