Skip to content

Commit e3aec6a

Browse files
authored
Merge pull request #4 from flutter/master
Merging changes from flutter/flutter
2 parents 1755464 + 3f3a367 commit e3aec6a

File tree

111 files changed

+2587
-1067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+2587
-1067
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ install:
1717
env:
1818
- SHARD=analyze
1919
- SHARD=tests
20+
- SHARD=coverage
2021
- SHARD=docs
2122
before_script:
2223
- ./dev/bots/travis_setup.sh

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# incompatible way, this version number might not change. Instead, the version
77
# number for package:flutter will update to reflect that change.
88

9-
0.0.10-dev
9+
0.0.11-dev

bin/internal/engine.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18fdfb86bb3876fcbb4e1d25e5b2aad0c5cd669f
1+
fffe502d437ac7931f08c6cef3e3f71fbd36adaa

dev/benchmarks/complex_layout/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ flutter {
4848
}
4949

5050
dependencies {
51-
androidTestCompile 'com.android.support:support-annotations:25.0.0'
51+
androidTestCompile 'com.android.support:support-annotations:25.4.0'
5252
androidTestCompile 'com.android.support.test:runner:0.5'
5353
androidTestCompile 'com.android.support.test:rules:0.5'
5454
}

dev/benchmarks/complex_layout/android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ buildscript {
1111
allprojects {
1212
repositories {
1313
jcenter()
14+
maven {
15+
url "https://maven.google.com"
16+
}
1417
}
1518
}
1619

dev/benchmarks/microbenchmarks/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ flutter {
4040
}
4141

4242
dependencies {
43-
androidTestCompile 'com.android.support:support-annotations:25.0.0'
43+
androidTestCompile 'com.android.support:support-annotations:25.4.0'
4444
androidTestCompile 'com.android.support.test:runner:0.5'
4545
androidTestCompile 'com.android.support.test:rules:0.5'
4646
}

dev/benchmarks/microbenchmarks/android/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ buildscript {
1111
allprojects {
1212
repositories {
1313
jcenter()
14+
maven {
15+
url "https://maven.google.com"
16+
}
1417
}
1518
}
1619

dev/bots/analyze-sample-code.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ Future<Null> main() async {
130130
}
131131
final List<String> buffer = <String>[];
132132
buffer.add('// generated code');
133+
buffer.add('import \'dart:async\';');
133134
buffer.add('import \'dart:math\' as math;');
134135
buffer.add('import \'dart:ui\' as ui;');
135136
for (FileSystemEntity file in flutterPackage.listSync(recursive: false, followLinks: false)) {

dev/bots/docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88
bin/flutter --version
99

1010
# Install dartdoc.
11-
bin/cache/dart-sdk/bin/pub global activate dartdoc 0.12.0
11+
bin/cache/dart-sdk/bin/pub global activate dartdoc 0.13.0+1
1212

1313
# This script generates a unified doc set, and creates
1414
# a custom index.html, placing everything into dev/docs/doc.

dev/bots/test.dart

Lines changed: 107 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import 'dart:io';
88

99
import 'package:path/path.dart' as path;
1010

11+
typedef Future<Null> ShardRunner();
12+
1113
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
1214
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
1315
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Platform.isWindows ? 'dart.exe' : 'dart');
@@ -22,6 +24,13 @@ final String yellow = hasColor ? '\x1B[33m' : '';
2224
final String cyan = hasColor ? '\x1B[36m' : '';
2325
final String reset = hasColor ? '\x1B[0m' : '';
2426

27+
const Map<String, ShardRunner> _kShards = const <String, ShardRunner>{
28+
'docs': _generateDocs,
29+
'analyze': _analyzeRepo,
30+
'tests': _runTests,
31+
'coverage': _runCoverage,
32+
};
33+
2534
/// When you call this, you can set FLUTTER_TEST_ARGS to pass custom
2635
/// arguments to flutter test. For example, you might want to call this
2736
/// script using FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt to
@@ -33,94 +42,111 @@ final String reset = hasColor ? '\x1B[0m' : '';
3342
/// SHARD=analyze bin/cache/dart-sdk/bin/dart dev/bots/test.dart
3443
/// FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt bin/cache/dart-sdk/bin/dart dev/bots/test.dart
3544
Future<Null> main() async {
36-
if (Platform.environment['SHARD'] == 'docs') {
37-
print('${bold}DONE: test.dart does nothing in the docs shard.$reset');
38-
} else if (Platform.environment['SHARD'] == 'analyze') {
39-
// Analyze all the Dart code in the repo.
40-
await _runFlutterAnalyze(flutterRoot,
41-
options: <String>['--flutter-repo'],
42-
);
45+
final String shard = Platform.environment['SHARD'] ?? 'tests';
46+
if (!_kShards.containsKey(shard))
47+
throw new ArgumentError('Invalid shard: $shard');
48+
await _kShards[shard]();
49+
}
4350

44-
// Analyze all the sample code in the repo
45-
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'bots', 'analyze-sample-code.dart')],
46-
workingDirectory: flutterRoot,
47-
);
51+
Future<Null> _generateDocs() async {
52+
print('${bold}DONE: test.dart does nothing in the docs shard.$reset');
53+
}
4854

49-
// Try with the --watch analyzer, to make sure it returns success also.
50-
// The --benchmark argument exits after one run.
51-
await _runFlutterAnalyze(flutterRoot,
52-
options: <String>['--flutter-repo', '--watch', '--benchmark'],
53-
);
55+
Future<Null> _analyzeRepo() async {
56+
// Analyze all the Dart code in the repo.
57+
await _runFlutterAnalyze(flutterRoot,
58+
options: <String>['--flutter-repo'],
59+
);
5460

55-
// Try an analysis against a big version of the gallery.
56-
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart')],
57-
workingDirectory: flutterRoot,
58-
);
59-
await _runFlutterAnalyze(path.join(flutterRoot, 'dev', 'benchmarks', 'mega_gallery'),
60-
options: <String>['--watch', '--benchmark'],
61-
);
61+
// Analyze all the sample code in the repo
62+
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'bots', 'analyze-sample-code.dart')],
63+
workingDirectory: flutterRoot,
64+
);
6265

63-
print('${bold}DONE: Analysis successful.$reset');
64-
} else {
65-
// Verify that the tests actually return failure on failure and success on success.
66-
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
67-
await _runFlutterTest(automatedTests,
68-
script: path.join('test_smoke_test', 'fail_test.dart'),
69-
expectFailure: true,
70-
printOutput: false,
71-
);
72-
await _runFlutterTest(automatedTests,
73-
script: path.join('test_smoke_test', 'pass_test.dart'),
74-
printOutput: false,
75-
);
76-
await _runFlutterTest(automatedTests,
77-
script: path.join('test_smoke_test', 'crash1_test.dart'),
78-
expectFailure: true,
79-
printOutput: false,
80-
);
81-
await _runFlutterTest(automatedTests,
82-
script: path.join('test_smoke_test', 'crash2_test.dart'),
83-
expectFailure: true,
84-
printOutput: false,
85-
);
86-
await _runFlutterTest(automatedTests,
87-
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
88-
expectFailure: true,
89-
printOutput: false,
90-
);
91-
await _runFlutterTest(automatedTests,
92-
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
93-
expectFailure: true,
94-
printOutput: false,
95-
);
96-
await _runCommand(flutter, <String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
97-
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
98-
expectFailure: true,
99-
printOutput: false,
100-
);
66+
// Try with the --watch analyzer, to make sure it returns success also.
67+
// The --benchmark argument exits after one run.
68+
await _runFlutterAnalyze(flutterRoot,
69+
options: <String>['--flutter-repo', '--watch', '--benchmark'],
70+
);
10171

102-
final List<String> coverageFlags = <String>[];
103-
if (Platform.environment['TRAVIS'] != null && Platform.environment['TRAVIS_PULL_REQUEST'] == 'false')
104-
coverageFlags.add('--coverage');
72+
// Try an analysis against a big version of the gallery.
73+
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart')],
74+
workingDirectory: flutterRoot,
75+
);
76+
await _runFlutterAnalyze(path.join(flutterRoot, 'dev', 'benchmarks', 'mega_gallery'),
77+
options: <String>['--watch', '--benchmark'],
78+
);
10579

106-
// Run tests.
107-
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
108-
options: coverageFlags,
109-
);
110-
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
111-
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
112-
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));
113-
114-
await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'));
115-
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
116-
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
117-
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
118-
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
119-
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
120-
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));
121-
122-
print('${bold}DONE: All tests successful.$reset');
80+
print('${bold}DONE: Analysis successful.$reset');
81+
}
82+
83+
Future<Null> _runTests() async {
84+
// Verify that the tests actually return failure on failure and success on success.
85+
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
86+
await _runFlutterTest(automatedTests,
87+
script: path.join('test_smoke_test', 'fail_test.dart'),
88+
expectFailure: true,
89+
printOutput: false,
90+
);
91+
await _runFlutterTest(automatedTests,
92+
script: path.join('test_smoke_test', 'pass_test.dart'),
93+
printOutput: false,
94+
);
95+
await _runFlutterTest(automatedTests,
96+
script: path.join('test_smoke_test', 'crash1_test.dart'),
97+
expectFailure: true,
98+
printOutput: false,
99+
);
100+
await _runFlutterTest(automatedTests,
101+
script: path.join('test_smoke_test', 'crash2_test.dart'),
102+
expectFailure: true,
103+
printOutput: false,
104+
);
105+
await _runFlutterTest(automatedTests,
106+
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
107+
expectFailure: true,
108+
printOutput: false,
109+
);
110+
await _runFlutterTest(automatedTests,
111+
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
112+
expectFailure: true,
113+
printOutput: false,
114+
);
115+
await _runCommand(flutter, <String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
116+
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
117+
expectFailure: true,
118+
printOutput: false,
119+
);
120+
121+
// Run tests.
122+
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'));
123+
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
124+
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
125+
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));
126+
127+
await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'));
128+
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
129+
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
130+
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
131+
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
132+
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
133+
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));
134+
135+
print('${bold}DONE: All tests successful.$reset');
136+
}
137+
138+
Future<Null> _runCoverage() async {
139+
if (Platform.environment['TRAVIS'] == null ||
140+
Platform.environment['TRAVIS_PULL_REQUEST'] != 'false') {
141+
print('${bold}DONE: test.dart does not run coverage for Travis pull requests');
142+
return;
123143
}
144+
145+
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
146+
options: const <String>['--coverage'],
147+
);
148+
149+
print('${bold}DONE: Coverage collection successful.$reset');
124150
}
125151

126152
Future<Null> _pubRunTest(

0 commit comments

Comments
 (0)