add missing type parameter on methods (#22096)
This commit is contained in:
committed by
GitHub
parent
48fb726b01
commit
f62afdcf57
@@ -30,8 +30,8 @@ void main() {
|
||||
);
|
||||
final StreamController<String> stdout = StreamController<String>.broadcast();
|
||||
run.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
stdout.add(line);
|
||||
@@ -46,12 +46,12 @@ void main() {
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('run:stderr: $line');
|
||||
});
|
||||
run.exitCode.then((int exitCode) { ok = false; });
|
||||
run.exitCode.then<void>((int exitCode) { ok = false; });
|
||||
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
|
||||
if (!ok)
|
||||
throw 'Failed to run test app.';
|
||||
@@ -114,14 +114,14 @@ class DriveHelper {
|
||||
<String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--keep-app-running', '--driver', 'test_driver/commands_${name}_test.dart'],
|
||||
);
|
||||
drive.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('drive:stdout: $line');
|
||||
});
|
||||
drive.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('drive:stderr: $line');
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ Future<Null> main() async {
|
||||
int publicMembers = 0;
|
||||
int otherErrors = 0;
|
||||
int otherLines = 0;
|
||||
await for (String entry in analysis.stdout.transform(utf8.decoder).transform(const LineSplitter())) {
|
||||
await for (String entry in analysis.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
||||
entry = entry.trim();
|
||||
print('analyzer stdout: $entry');
|
||||
if (entry == 'Building flutter tool...') {
|
||||
@@ -36,7 +36,7 @@ Future<Null> main() async {
|
||||
otherLines += 1;
|
||||
}
|
||||
}
|
||||
await for (String entry in analysis.stderr.transform(utf8.decoder).transform(const LineSplitter())) {
|
||||
await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
||||
print('analyzer stderr: $entry');
|
||||
if (entry.startsWith('[lint] ')) {
|
||||
// ignore this line
|
||||
|
||||
@@ -26,8 +26,8 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
|
||||
|
||||
int exitCode;
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('attach:stdout: $line');
|
||||
stdout.add(line);
|
||||
@@ -43,14 +43,14 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
|
||||
finished.complete();
|
||||
});
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stderr: $line');
|
||||
stdout.add(line);
|
||||
});
|
||||
|
||||
process.exitCode.then((int processExitCode) { exitCode = processExitCode; });
|
||||
process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
|
||||
|
||||
Future<dynamic> eventOrExit(Future<Null> event) {
|
||||
return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]);
|
||||
|
||||
@@ -45,7 +45,7 @@ Future<int> runTest() async {
|
||||
);
|
||||
int badLines = 0;
|
||||
TestStep step = TestStep.starting;
|
||||
await for (String entry in analysis.stdout.transform(utf8.decoder).transform(const LineSplitter())) {
|
||||
await for (String entry in analysis.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
||||
print('test stdout ($step): $entry');
|
||||
if (step == TestStep.starting && entry == 'Building flutter tool...') {
|
||||
// ignore this line
|
||||
@@ -76,7 +76,7 @@ Future<int> runTest() async {
|
||||
}
|
||||
}
|
||||
}
|
||||
await for (String entry in analysis.stderr.transform(utf8.decoder).transform(const LineSplitter())) {
|
||||
await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
|
||||
print('test stderr: $entry');
|
||||
badLines += 1;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ class _Dependencies {
|
||||
.replaceAllMapped(_separatorExpr, (Match match) => '${match.group(1)}\n')
|
||||
.split('\n')
|
||||
// Expand escape sequences, so that '\ ', for example,ß becomes ' '
|
||||
.map((String path) => path.replaceAllMapped(_escapeExpr, (Match match) => match.group(1)).trim())
|
||||
.map<String>((String path) => path.replaceAllMapped(_escapeExpr, (Match match) => match.group(1)).trim())
|
||||
.where((String path) => path.isNotEmpty)
|
||||
.toSet();
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ void main() {
|
||||
<String>['run', '--verbose', '-d', device.deviceId, '--route', '/smuggle-it', 'lib/route.dart'],
|
||||
);
|
||||
run.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
if (vmServicePort == null) {
|
||||
@@ -52,12 +52,12 @@ void main() {
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('run:stderr: $line');
|
||||
});
|
||||
run.exitCode.then((int exitCode) { ok = false; });
|
||||
run.exitCode.then<void>((int exitCode) { ok = false; });
|
||||
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
|
||||
if (!ok)
|
||||
throw 'Failed to run test app.';
|
||||
@@ -67,14 +67,14 @@ void main() {
|
||||
<String>['drive', '--use-existing-app', 'http://127.0.0.1:$vmServicePort/', '--no-keep-app-running', 'lib/route.dart'],
|
||||
);
|
||||
drive.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('drive:stdout: $line');
|
||||
});
|
||||
drive.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('drive:stderr: $line');
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ void main() {
|
||||
}
|
||||
|
||||
Stream<String> transformToLines(Stream<List<int>> byteStream) {
|
||||
return byteStream.transform(utf8.decoder).transform(const LineSplitter());
|
||||
return byteStream.transform<String>(utf8.decoder).transform<String>(const LineSplitter());
|
||||
}
|
||||
|
||||
task(() async {
|
||||
@@ -74,7 +74,7 @@ void main() {
|
||||
transformToLines(run.stderr).listen((String line) {
|
||||
stderr.writeln('run:stderr: $line');
|
||||
});
|
||||
run.exitCode.then((int exitCode) {
|
||||
run.exitCode.then<void>((int exitCode) {
|
||||
ok = false;
|
||||
});
|
||||
await Future.any<dynamic>(<Future<dynamic>>[ready.future, run.exitCode]);
|
||||
|
||||
@@ -29,8 +29,8 @@ void main() {
|
||||
final List<String> stderr = <String>[];
|
||||
int runExitCode;
|
||||
run.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
stdout.add(line);
|
||||
@@ -38,13 +38,13 @@ void main() {
|
||||
ready.complete();
|
||||
});
|
||||
run.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stderr: $line');
|
||||
stdout.add(line);
|
||||
});
|
||||
run.exitCode.then((int exitCode) { runExitCode = exitCode; });
|
||||
run.exitCode.then<void>((int exitCode) { runExitCode = exitCode; });
|
||||
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
|
||||
if (runExitCode != null)
|
||||
throw 'Failed to run test app; runner unexpected exited, with exit code $runExitCode.';
|
||||
|
||||
@@ -29,8 +29,8 @@ void main() {
|
||||
<String>['run', '--verbose', '-d', device.deviceId, 'lib/main.dart'],
|
||||
);
|
||||
run.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('run:stdout: $line');
|
||||
if (vmServicePort == null) {
|
||||
@@ -44,12 +44,12 @@ void main() {
|
||||
}
|
||||
});
|
||||
run.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('run:stderr: $line');
|
||||
});
|
||||
run.exitCode.then((int exitCode) { ok = false; });
|
||||
run.exitCode.then<void>((int exitCode) { ok = false; });
|
||||
await Future.any<dynamic>(<Future<dynamic>>[ ready.future, run.exitCode ]);
|
||||
if (!ok)
|
||||
throw 'Failed to run test app.';
|
||||
|
||||
@@ -54,7 +54,7 @@ Future<double> findCostsForRepo() async {
|
||||
workingDirectory: flutterDirectory.path,
|
||||
);
|
||||
double total = 0.0;
|
||||
await for (String entry in git.stdout.transform(utf8.decoder).transform(const LineSplitter()))
|
||||
await for (String entry in git.stdout.transform<String>(utf8.decoder).transform<String>(const LineSplitter()))
|
||||
total += await findCostsForFile(File(path.join(flutterDirectory.path, entry)));
|
||||
final int gitExitCode = await git.exitCode;
|
||||
if (gitExitCode != 0)
|
||||
|
||||
@@ -129,7 +129,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
final List<Device> allDevices = (await discoverDevices())
|
||||
.map((String id) => AndroidDevice(deviceId: id))
|
||||
.map<Device>((String id) => AndroidDevice(deviceId: id))
|
||||
.toList();
|
||||
|
||||
if (allDevices.isEmpty)
|
||||
@@ -298,19 +298,19 @@ class AndroidDevice implements Device {
|
||||
await adb(<String>['logcat', '--clear']);
|
||||
final Process process = await startProcess(adbPath, <String>['-s', deviceId, 'logcat']);
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('adb logcat: $line');
|
||||
stream.sink.add(line);
|
||||
}, onDone: () { stdoutDone.complete(); });
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('adb logcat stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
process.exitCode.then((int exitCode) {
|
||||
process.exitCode.then<void>((int exitCode) {
|
||||
print('adb logcat process terminated with exit code $exitCode');
|
||||
if (!aborted) {
|
||||
stream.addError(BuildFailedError('adb logcat failed with exit code $exitCode.'));
|
||||
@@ -374,7 +374,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
final List<IosDevice> allDevices = (await discoverDevices())
|
||||
.map((String id) => IosDevice(deviceId: id))
|
||||
.map<IosDevice>((String id) => IosDevice(deviceId: id))
|
||||
.toList();
|
||||
|
||||
if (allDevices.isEmpty)
|
||||
@@ -387,7 +387,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
@override
|
||||
Future<List<String>> discoverDevices() async {
|
||||
final List<String> iosDeviceIDs = LineSplitter.split(await eval('idevice_id', <String>['-l']))
|
||||
.map((String line) => line.trim())
|
||||
.map<String>((String line) => line.trim())
|
||||
.where((String line) => line.isNotEmpty)
|
||||
.toList();
|
||||
if (iosDeviceIDs.isEmpty)
|
||||
|
||||
@@ -83,7 +83,7 @@ Manifest _validateAndParseManifest(Map<dynamic, dynamic> manifestYaml) {
|
||||
List<ManifestTask> _validateAndParseTasks(dynamic tasksYaml) {
|
||||
_checkType(tasksYaml is Map, tasksYaml, 'Value of "tasks"', 'dictionary');
|
||||
final List<dynamic> sortedKeys = tasksYaml.keys.toList()..sort();
|
||||
return sortedKeys.map((dynamic taskName) => _validateAndParseTask(taskName, tasksYaml[taskName])).toList();
|
||||
return sortedKeys.map<ManifestTask>((dynamic taskName) => _validateAndParseTask(taskName, tasksYaml[taskName])).toList();
|
||||
}
|
||||
|
||||
ManifestTask _validateAndParseTask(dynamic taskName, dynamic taskYaml) {
|
||||
|
||||
@@ -44,8 +44,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
|
||||
final Completer<int> port = Completer<int>();
|
||||
|
||||
final StreamSubscription<String> stdoutSub = runner.stdout
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(const Utf8Decoder())
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
if (!port.isCompleted) {
|
||||
final int portValue = parseServicePort(line, prefix: 'Observatory listening on ');
|
||||
@@ -58,8 +58,8 @@ Future<Map<String, dynamic>> runTask(String taskName, { bool silent = false }) a
|
||||
});
|
||||
|
||||
final StreamSubscription<String> stderrSub = runner.stderr
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(const Utf8Decoder())
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('[$taskName] [STDERR] $line');
|
||||
});
|
||||
|
||||
@@ -172,14 +172,14 @@ Future<String> getCurrentFlutterRepoCommit() {
|
||||
return null;
|
||||
}
|
||||
|
||||
return inDirectory(flutterDirectory, () {
|
||||
return inDirectory<String>(flutterDirectory, () {
|
||||
return eval('git', <String>['rev-parse', 'HEAD']);
|
||||
});
|
||||
}
|
||||
|
||||
Future<DateTime> getFlutterRepoCommitTimestamp(String commit) {
|
||||
// git show -s --format=%at 4b546df7f0b3858aaaa56c4079e5be1ba91fbb65
|
||||
return inDirectory(flutterDirectory, () async {
|
||||
return inDirectory<DateTime>(flutterDirectory, () async {
|
||||
final String unixTimestamp = await eval('git', <String>[
|
||||
'show',
|
||||
'-s',
|
||||
@@ -235,7 +235,7 @@ Future<Process> startProcess(
|
||||
final ProcessInfo processInfo = ProcessInfo(command, process);
|
||||
_runningProcesses.add(processInfo);
|
||||
|
||||
process.exitCode.then((int exitCode) {
|
||||
process.exitCode.then<void>((int exitCode) {
|
||||
print('"$executable" exit code: $exitCode');
|
||||
_runningProcesses.remove(processInfo);
|
||||
});
|
||||
@@ -273,14 +273,14 @@ Future<int> exec(
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stdout: $line');
|
||||
}, onDone: () { stdoutDone.complete(); });
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
@@ -310,15 +310,15 @@ Future<String> eval(
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stdout: $line');
|
||||
output.writeln(line);
|
||||
}, onDone: () { stdoutDone.complete(); });
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
@@ -427,11 +427,11 @@ Future<Null> getFlutter(String revision) async {
|
||||
flutterDirectory.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
await inDirectory(flutterDirectory.parent, () async {
|
||||
await inDirectory<void>(flutterDirectory.parent, () async {
|
||||
await exec('git', <String>['clone', 'https://github.com/flutter/flutter.git']);
|
||||
});
|
||||
|
||||
await inDirectory(flutterDirectory, () async {
|
||||
await inDirectory<void>(flutterDirectory, () async {
|
||||
await exec('git', <String>['checkout', revision]);
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ const int _kRunsPerBenchmark = 3;
|
||||
Directory get _megaGalleryDirectory => dir(path.join(Directory.systemTemp.path, 'mega_gallery'));
|
||||
|
||||
Future<TaskResult> analyzerBenchmarkTask() async {
|
||||
await inDirectory(flutterDirectory, () async {
|
||||
await inDirectory<void>(flutterDirectory, () async {
|
||||
rmTree(_megaGalleryDirectory);
|
||||
mkdirs(_megaGalleryDirectory);
|
||||
await dart(<String>['dev/tools/mega_gallery.dart', '--out=${_megaGalleryDirectory.path}']);
|
||||
@@ -74,7 +74,7 @@ abstract class _Benchmark {
|
||||
Future<double> execute(int iteration, int targetIterations) async {
|
||||
section('Analyze $title ${watch ? 'with watcher' : ''} - ${iteration + 1} / $targetIterations');
|
||||
final Stopwatch stopwatch = Stopwatch();
|
||||
await inDirectory(directory, () async {
|
||||
await inDirectory<void>(directory, () async {
|
||||
stopwatch.start();
|
||||
await flutter('analyze', options: options);
|
||||
stopwatch.stop();
|
||||
|
||||
@@ -28,7 +28,7 @@ class GalleryTransitionTest {
|
||||
final String deviceId = device.deviceId;
|
||||
final Directory galleryDirectory =
|
||||
dir('${flutterDirectory.path}/examples/flutter_gallery');
|
||||
await inDirectory(galleryDirectory, () async {
|
||||
await inDirectory<void>(galleryDirectory, () async {
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
|
||||
|
||||
@@ -29,11 +29,11 @@ TaskFunction createHotModeTest() {
|
||||
int hotReloadCount = 0;
|
||||
Map<String, dynamic> twoReloadsData;
|
||||
Map<String, dynamic> freshRestartReloadsData;
|
||||
await inDirectory(flutterDirectory, () async {
|
||||
await inDirectory<void>(flutterDirectory, () async {
|
||||
rmTree(_editedFlutterGalleryDir);
|
||||
mkdirs(_editedFlutterGalleryDir);
|
||||
recursiveCopy(flutterGalleryDir, _editedFlutterGalleryDir);
|
||||
await inDirectory(_editedFlutterGalleryDir, () async {
|
||||
await inDirectory<void>(_editedFlutterGalleryDir, () async {
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
|
||||
await prepareProvisioningCertificates(_editedFlutterGalleryDir.path);
|
||||
{
|
||||
@@ -46,8 +46,8 @@ TaskFunction createHotModeTest() {
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
if (line.contains('\] Reloaded ')) {
|
||||
if (hotReloadCount == 0) {
|
||||
@@ -72,8 +72,8 @@ TaskFunction createHotModeTest() {
|
||||
stdoutDone.complete();
|
||||
});
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stderr: $line');
|
||||
}, onDone: () {
|
||||
@@ -99,8 +99,8 @@ TaskFunction createHotModeTest() {
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
process.stdout
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
if (line.contains('\] Reloaded ')) {
|
||||
process.stdin.writeln('q');
|
||||
@@ -110,8 +110,8 @@ TaskFunction createHotModeTest() {
|
||||
stdoutDone.complete();
|
||||
});
|
||||
process.stderr
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
print('stderr: $line');
|
||||
}, onDone: () {
|
||||
|
||||
@@ -73,7 +73,7 @@ class DriverTest {
|
||||
final List<String> extraOptions;
|
||||
|
||||
Future<TaskResult> call() {
|
||||
return inDirectory(testDirectory, () async {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
|
||||
@@ -15,7 +15,7 @@ Future<TaskResult> runEndToEndTests() async {
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
final Directory testDirectory = dir('${flutterDirectory.path}/dev/integration_tests/ui');
|
||||
await inDirectory(testDirectory, () async {
|
||||
await inDirectory<void>(testDirectory, () async {
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
|
||||
|
||||
@@ -78,8 +78,8 @@ Future<Map<String, double>> _readJsonResults(Process process) {
|
||||
final Completer<Map<String, double>> completer = Completer<Map<String, double>>();
|
||||
|
||||
final StreamSubscription<String> stderrSub = process.stderr
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(const Utf8Decoder())
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) {
|
||||
stderr.writeln('[STDERR] $line');
|
||||
});
|
||||
@@ -87,8 +87,8 @@ Future<Map<String, double>> _readJsonResults(Process process) {
|
||||
bool processWasKilledIntentionally = false;
|
||||
bool resultsHaveBeenParsed = false;
|
||||
final StreamSubscription<String> stdoutSub = process.stdout
|
||||
.transform(const Utf8Decoder())
|
||||
.transform(const LineSplitter())
|
||||
.transform<String>(const Utf8Decoder())
|
||||
.transform<String>(const LineSplitter())
|
||||
.listen((String line) async {
|
||||
print(line);
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ TaskFunction createBasicMaterialCompileTest() {
|
||||
|
||||
rmTree(sampleDir);
|
||||
|
||||
await inDirectory(Directory.systemTemp, () async {
|
||||
await inDirectory<void>(Directory.systemTemp, () async {
|
||||
await flutter('create', options: <String>[sampleAppName]);
|
||||
});
|
||||
|
||||
@@ -95,7 +95,7 @@ class StartupTest {
|
||||
final bool reportMetrics;
|
||||
|
||||
Future<TaskResult> run() async {
|
||||
return await inDirectory(testDirectory, () async {
|
||||
return await inDirectory<TaskResult>(testDirectory, () async {
|
||||
final String deviceId = (await devices.workingDevice).deviceId;
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
@@ -131,7 +131,7 @@ class PerfTest {
|
||||
final String timelineFileName;
|
||||
|
||||
Future<TaskResult> run() {
|
||||
return inDirectory(testDirectory, () async {
|
||||
return inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
final String deviceId = device.deviceId;
|
||||
@@ -183,7 +183,7 @@ class CompileTest {
|
||||
final bool reportPackageContentSizes;
|
||||
|
||||
Future<TaskResult> run() async {
|
||||
return await inDirectory(testDirectory, () async {
|
||||
return await inDirectory<TaskResult>(testDirectory, () async {
|
||||
final Device device = await devices.workingDevice;
|
||||
await device.unlock();
|
||||
await flutter('packages', options: <String>['get']);
|
||||
@@ -402,7 +402,7 @@ class MemoryTest {
|
||||
Device _device;
|
||||
|
||||
Future<TaskResult> run() {
|
||||
return inDirectory(project, () async {
|
||||
return inDirectory<TaskResult>(project, () async {
|
||||
// This test currently only works on Android, because device.logcat,
|
||||
// device.getMemoryStats, etc, aren't implemented for iOS.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Future<TaskResult> samplePageCatalogGenerator(String authorizationToken) async {
|
||||
final String deviceId = device.deviceId;
|
||||
|
||||
final Directory catalogDirectory = dir('${flutterDirectory.path}/examples/catalog');
|
||||
await inDirectory(catalogDirectory, () async {
|
||||
await inDirectory<void>(catalogDirectory, () async {
|
||||
await flutter('packages', options: <String>['get']);
|
||||
|
||||
final bool isIosDevice = deviceOperatingSystem == DeviceOperatingSystem.ios;
|
||||
|
||||
@@ -65,7 +65,7 @@ class Upload {
|
||||
} else {
|
||||
// TODO(hansmuller): only retry on 5xx and 429 responses
|
||||
logMessage('Request to save "$name" (length ${content.length}) failed with status ${response.statusCode}, will retry');
|
||||
logMessage(await response.transform(utf8.decoder).join());
|
||||
logMessage(await response.transform<String>(utf8.decoder).join());
|
||||
}
|
||||
return response.statusCode == HttpStatus.ok;
|
||||
} on TimeoutException catch (_) {
|
||||
@@ -104,7 +104,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
|
||||
while (uploads.any(Upload.isNotComplete)) {
|
||||
final HttpClient client = HttpClient();
|
||||
uploads = uploads.where(Upload.isNotComplete).toList();
|
||||
await Future.wait(uploads.map((Upload upload) => upload.run(client)));
|
||||
await Future.wait<bool>(uploads.map<Future<bool>>((Upload upload) => upload.run(client)));
|
||||
client.close(force: true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user