Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging changes from flutter/flutter #4

Merged
merged 51 commits into from
Jun 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
99e343a
Re-title, format iOS device tests (#10733)
cbracken Jun 15, 2017
d1feb1a
Coverage: fix installHook API (#10747)
skybrian Jun 15, 2017
615410d
Inject iOS, Android workflows via context (#10750)
cbracken Jun 15, 2017
bd67926
Run coverage in a dedicated shard on Travis (#10755)
tvolkert Jun 16, 2017
4b957bf
Keep provisioning step (#10736)
goderbauer Jun 16, 2017
432ffde
remove usages of booted (#10741)
xster Jun 16, 2017
e56c885
Fix simctl race (#10757)
xster Jun 16, 2017
45446ae
first round of future awaits (#10760)
xster Jun 16, 2017
d6ec71d
Extract libimobiledevice tools interface (#10759)
cbracken Jun 16, 2017
c04f712
Refactor Xcode instance lookup (#10763)
cbracken Jun 16, 2017
3db402e
Roll Flutter Engine dependency (#10753)
aam Jun 16, 2017
6965312
Align doubles to 8 bytes in the StandardMessageCodec (#10758)
jason-simmons Jun 16, 2017
bcac316
Eliminate direct invocations of idevice_id for iOS (#10777)
cbracken Jun 16, 2017
73df49a
Eliminate unused libimobiledevice tool refs (#10778)
cbracken Jun 16, 2017
aaf82b3
Bump version in preparation for a release of the alpha branch (#10779)
tvolkert Jun 16, 2017
b474557
Eliminate unnecessary public getters for iOS tools (#10784)
cbracken Jun 16, 2017
3b6d84b
modernize iOS device lookup in driver (#10780)
yjbanov Jun 16, 2017
5ae6b7b
Increment version to `<x>-dev` (#10794)
tvolkert Jun 16, 2017
0339351
address comments (#10786)
xster Jun 16, 2017
6650213
Extract all libimobiledevice invocations to IMobileDevice class (#10793)
cbracken Jun 16, 2017
2d79ce8
don't send analytics when run from another runner (#10789)
sethladd Jun 16, 2017
5344ffc
Move intrinsics tests to test mode only. (#10796)
Hixie Jun 16, 2017
37bb5f1
Use Xcode instruments to list devices (#10801)
cbracken Jun 16, 2017
41e1eb5
Various docs easy fixes (#10797)
Hixie Jun 16, 2017
972be9c
Make device discovery asynchronous (#10803)
cbracken Jun 17, 2017
b2909a2
Revert use of Xcode instruments for device lookup (#10806)
cbracken Jun 17, 2017
28fd54c
move getTransformTo method from RenderBox to RenderObject. (#10430)
jacob314 Jun 17, 2017
4b707c1
Change for consideration: URL for plugin text (#10720)
lukechurch Jun 18, 2017
cfa0a2d
Look for APKs at the path used by Android Gradle plugin 3.0 (#10798)
jason-simmons Jun 19, 2017
cf93039
Roll engine (#10808)
Hixie Jun 19, 2017
95eba52
Define some annotations for generating the widget catalog. (#10816)
Hixie Jun 19, 2017
f8c4a6e
Defer the animation of text fields to the caret position (#10782)
jason-simmons Jun 19, 2017
1d9f009
Re-enable use of instruments for iOS device lookup (#10838)
cbracken Jun 19, 2017
400a62d
Eliminate use of ideviceinfo in flutter_tools (#10804)
cbracken Jun 19, 2017
58fe823
Use Xcode instruments for devicelab device lookup (#10840)
cbracken Jun 19, 2017
4094142
Sample code for dialogs. (#10812)
Hixie Jun 20, 2017
c14470e
dont' validate against webstorm (#10828)
devoncarew Jun 20, 2017
b471a9c
send channel name as a custom dimension (#10814)
sethladd Jun 20, 2017
40db1e4
Added InputDecoration helperText, helperStyle (#10852)
Jun 20, 2017
6d32b33
Text selection handles track scrolled text fields (#10805)
Hixie Jun 20, 2017
1be406b
Move the discovered Java installation to the front of PATH when runni…
jason-simmons Jun 20, 2017
7d16a96
Roll engine to fffe502d437ac7931f08c6cef3e3f71fbd36adaa (#10859)
cbracken Jun 20, 2017
0e1b652
Make Demos in flutter_gallery more accessible (#10832)
goderbauer Jun 20, 2017
5fee978
Add version information to dartdoc footer (#10844)
jcollins-g Jun 20, 2017
2052741
Use a lookup table to calculate the number of days in a month (#10860)
jason-simmons Jun 20, 2017
2f97991
Update templates to include google's maven repository (#10842)
goderbauer Jun 20, 2017
f01e941
change --machine flag for `flutter test` to report test progress as J…
skybrian Jun 20, 2017
8b888e6
Apply tempalte changes to examples (#10865)
goderbauer Jun 20, 2017
d46e208
Change all ocurrences of '$runtimeType#$hashCode' to use the idAndTyp…
jacob314 Jun 21, 2017
ceb814a
Revert "Change all ocurrences of '$runtimeType#$hashCode' to use the …
jacob314 Jun 21, 2017
3f3a367
Update dartdoc to 0.13.0+1 for flutter (#10863)
jcollins-g Jun 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install:
env:
- SHARD=analyze
- SHARD=tests
- SHARD=coverage
- SHARD=docs
before_script:
- ./dev/bots/travis_setup.sh
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# incompatible way, this version number might not change. Instead, the version
# number for package:flutter will update to reflect that change.

0.0.10-dev
0.0.11-dev
2 changes: 1 addition & 1 deletion bin/internal/engine.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18fdfb86bb3876fcbb4e1d25e5b2aad0c5cd669f
fffe502d437ac7931f08c6cef3e3f71fbd36adaa
2 changes: 1 addition & 1 deletion dev/benchmarks/complex_layout/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ flutter {
}

dependencies {
androidTestCompile 'com.android.support:support-annotations:25.0.0'
androidTestCompile 'com.android.support:support-annotations:25.4.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
}
3 changes: 3 additions & 0 deletions dev/benchmarks/complex_layout/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion dev/benchmarks/microbenchmarks/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ flutter {
}

dependencies {
androidTestCompile 'com.android.support:support-annotations:25.0.0'
androidTestCompile 'com.android.support:support-annotations:25.4.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
}
3 changes: 3 additions & 0 deletions dev/benchmarks/microbenchmarks/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Expand Down
1 change: 1 addition & 0 deletions dev/bots/analyze-sample-code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ Future<Null> main() async {
}
final List<String> buffer = <String>[];
buffer.add('// generated code');
buffer.add('import \'dart:async\';');
buffer.add('import \'dart:math\' as math;');
buffer.add('import \'dart:ui\' as ui;');
for (FileSystemEntity file in flutterPackage.listSync(recursive: false, followLinks: false)) {
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
bin/flutter --version

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

# This script generates a unified doc set, and creates
# a custom index.html, placing everything into dev/docs/doc.
Expand Down
188 changes: 107 additions & 81 deletions dev/bots/test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import 'dart:io';

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

typedef Future<Null> ShardRunner();

final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Platform.isWindows ? 'dart.exe' : 'dart');
Expand All @@ -22,6 +24,13 @@ final String yellow = hasColor ? '\x1B[33m' : '';
final String cyan = hasColor ? '\x1B[36m' : '';
final String reset = hasColor ? '\x1B[0m' : '';

const Map<String, ShardRunner> _kShards = const <String, ShardRunner>{
'docs': _generateDocs,
'analyze': _analyzeRepo,
'tests': _runTests,
'coverage': _runCoverage,
};

/// When you call this, you can set FLUTTER_TEST_ARGS to pass custom
/// arguments to flutter test. For example, you might want to call this
/// script using FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt to
Expand All @@ -33,94 +42,111 @@ final String reset = hasColor ? '\x1B[0m' : '';
/// SHARD=analyze bin/cache/dart-sdk/bin/dart dev/bots/test.dart
/// FLUTTER_TEST_ARGS=--local-engine=host_debug_unopt bin/cache/dart-sdk/bin/dart dev/bots/test.dart
Future<Null> main() async {
if (Platform.environment['SHARD'] == 'docs') {
print('${bold}DONE: test.dart does nothing in the docs shard.$reset');
} else if (Platform.environment['SHARD'] == 'analyze') {
// Analyze all the Dart code in the repo.
await _runFlutterAnalyze(flutterRoot,
options: <String>['--flutter-repo'],
);
final String shard = Platform.environment['SHARD'] ?? 'tests';
if (!_kShards.containsKey(shard))
throw new ArgumentError('Invalid shard: $shard');
await _kShards[shard]();
}

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

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

// Try an analysis against a big version of the gallery.
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart')],
workingDirectory: flutterRoot,
);
await _runFlutterAnalyze(path.join(flutterRoot, 'dev', 'benchmarks', 'mega_gallery'),
options: <String>['--watch', '--benchmark'],
);
// Analyze all the sample code in the repo
await _runCommand(dart, <String>[path.join(flutterRoot, 'dev', 'bots', 'analyze-sample-code.dart')],
workingDirectory: flutterRoot,
);

print('${bold}DONE: Analysis successful.$reset');
} else {
// Verify that the tests actually return failure on failure and success on success.
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'fail_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'pass_test.dart'),
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash1_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash2_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
expectFailure: true,
printOutput: false,
);
await _runCommand(flutter, <String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectFailure: true,
printOutput: false,
);
// Try with the --watch analyzer, to make sure it returns success also.
// The --benchmark argument exits after one run.
await _runFlutterAnalyze(flutterRoot,
options: <String>['--flutter-repo', '--watch', '--benchmark'],
);

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

// Run tests.
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
options: coverageFlags,
);
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));

await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));

print('${bold}DONE: All tests successful.$reset');
print('${bold}DONE: Analysis successful.$reset');
}

Future<Null> _runTests() async {
// Verify that the tests actually return failure on failure and success on success.
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'fail_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'pass_test.dart'),
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash1_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'crash2_test.dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'syntax_error_test.broken_dart'),
expectFailure: true,
printOutput: false,
);
await _runFlutterTest(automatedTests,
script: path.join('test_smoke_test', 'missing_import_test.broken_dart'),
expectFailure: true,
printOutput: false,
);
await _runCommand(flutter, <String>['drive', '--use-existing-app', '-t', path.join('test_driver', 'failure.dart')],
workingDirectory: path.join(flutterRoot, 'packages', 'flutter_driver'),
expectFailure: true,
printOutput: false,
);

// Run tests.
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_driver'));
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter_test'));
await _pubRunTest(path.join(flutterRoot, 'packages', 'flutter_tools'));

await _runAllDartTests(path.join(flutterRoot, 'dev', 'devicelab'));
await _runFlutterTest(path.join(flutterRoot, 'dev', 'manual_tests'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'hello_world'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'layers'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'stocks'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'flutter_gallery'));
await _runFlutterTest(path.join(flutterRoot, 'examples', 'catalog'));

print('${bold}DONE: All tests successful.$reset');
}

Future<Null> _runCoverage() async {
if (Platform.environment['TRAVIS'] == null ||
Platform.environment['TRAVIS_PULL_REQUEST'] != 'false') {
print('${bold}DONE: test.dart does not run coverage for Travis pull requests');
return;
}

await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'),
options: const <String>['--coverage'],
);

print('${bold}DONE: Coverage collection successful.$reset');
}

Future<Null> _pubRunTest(
Expand Down
2 changes: 1 addition & 1 deletion dev/bots/travis_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export PATH="$PWD/bin:$PWD/bin/cache/dart-sdk/bin:$PATH"

LCOV_FILE=./packages/flutter/coverage/lcov.info

if [ "$SHARD" = "tests" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ -f "$LCOV_FILE" ]; then
if [ "$SHARD" = "coverage" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ] && [ -f "$LCOV_FILE" ]; then
GSUTIL=$HOME/google-cloud-sdk/bin/gsutil
GCLOUD=$HOME/google-cloud-sdk/bin/gcloud

Expand Down
27 changes: 21 additions & 6 deletions dev/devicelab/lib/framework/adb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,31 @@ class IosDeviceDiscovery implements DeviceDiscovery {
_workingDevice = allDevices[new math.Random().nextInt(allDevices.length)];
}

// Physical device line format to be matched:
// My iPhone (10.3.2) [75b90e947c5f429fa67f3e9169fda0d89f0492f1]
//
// Other formats in output (desktop, simulator) to be ignored:
// my-mac-pro [2C10513E-4dA5-405C-8EF5-C44353DB3ADD]
// iPhone 6s (9.3) [F6CEE7CF-81EB-4448-81B4-1755288C7C11] (Simulator)
static final RegExp _deviceRegex = new RegExp(r'^.* +\(.*\) +\[(.*)\]$');

@override
Future<List<String>> discoverDevices() async {
// TODO: use the -k UniqueDeviceID option, which requires much less parsing.
final List<String> iosDeviceIds = grep('UniqueDeviceID', from: await eval('ideviceinfo', <String>[]))
.map((String line) => line.split(' ').last).toList();

if (iosDeviceIds.isEmpty)
final List<String> iosDeviceIDs = <String>[];
final Iterable<String> deviceLines = (await eval('instruments', <String>['-s', 'devices']))
.split('\n')
.map((String line) => line.trim());
for (String line in deviceLines) {
final Match match = _deviceRegex.firstMatch(line);
if (match != null) {
final String deviceID = match.group(1);
iosDeviceIDs.add(deviceID);
}
}
if (iosDeviceIDs.isEmpty)
throw 'No connected iOS devices found.';

return iosDeviceIds;
return iosDeviceIDs;
}

@override
Expand Down
23 changes: 11 additions & 12 deletions dev/devicelab/lib/framework/ios.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ const String _kTestXcconfigFileName = 'TestConfig.xcconfig';
const FileSystem _fs = const io.LocalFileSystem();

/// Patches the given Xcode project adding provisioning certificates and team
/// information required to build and run the project.
/// information required to build and run the project, if
/// FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG is set. If it is not set,
/// we rely on automatic signing by Xcode.
Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
final String certificateConfig = await _readProvisioningConfigFile();
await _patchXcconfigFilesIfNotPatched(flutterProjectPath);
if (certificateConfig == null) {
// No cert config available, rely on automatic signing by Xcode.
return;
}

await _patchXcconfigFilesIfNotPatched(flutterProjectPath);
final File testXcconfig = _fs.file(path.join(flutterProjectPath, 'ios/Flutter/$_kTestXcconfigFileName'));
await testXcconfig.writeAsString(certificateConfig);
}
Expand Down Expand Up @@ -76,18 +82,11 @@ $specificMessage
}

if (!dart_io.Platform.environment.containsKey(_kProvisioningConfigFileEnvironmentVariable)) {
throwUsageError('''
print('''
$_kProvisioningConfigFileEnvironmentVariable variable is not defined in your
environment. Please, define it and try again.

Example provisioning xcconfig:

ProvisioningStyle=Manual
CODE_SIGN_IDENTITY=...
PROVISIONING_PROFILE=...
DEVELOPMENT_TEAM=...
PROVISIONING_PROFILE_SPECIFIER=...
environment. Relying on automatic signing by Xcode...
'''.trim());
return null;
}

final String filePath = dart_io.Platform.environment[_kProvisioningConfigFileEnvironmentVariable];
Expand Down
5 changes: 1 addition & 4 deletions dev/devicelab/lib/tasks/gallery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@ class GalleryTransitionTest {
await inDirectory(galleryDirectory, () async {
await flutter('packages', options: <String>['get']);

if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
await prepareProvisioningCertificates(galleryDirectory.path);
// This causes an Xcode project to be created.
await flutter('build', options: <String>['ios', '--profile']);
}

final String testDriver = semanticsEnabled
? 'transitions_perf_with_semantics.dart'
Expand Down
Loading