apply lint prefer_void_to_null in dev/ (#22661)
This commit is contained in:
committed by
GitHub
parent
89c5ace117
commit
d340e2f229
@@ -177,7 +177,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
... do something interesting ...
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ List<String> _taskNames = <String>[];
|
||||
///
|
||||
/// The tasks are chosen depending on the command-line options
|
||||
/// (see [_argParser]).
|
||||
Future<Null> main(List<String> rawArgs) async {
|
||||
Future<void> main(List<String> rawArgs) async {
|
||||
ArgResults args;
|
||||
try {
|
||||
args = _argParser.parse(rawArgs);
|
||||
|
||||
@@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/analysis.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(analyzerBenchmarkTask);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/sample_catalog_generator.dart';
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() => samplePageCatalogGenerator(extractCloudAuthTokenArg(args)));
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
@@ -107,7 +107,7 @@ class DriveHelper {
|
||||
|
||||
final int vmServicePort;
|
||||
|
||||
Future<Null> drive(String name) async {
|
||||
Future<void> drive(String name) async {
|
||||
print('drive: running commands_$name check...');
|
||||
final Process drive = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutStartupTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutStartupTest());
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(MemoryTest(
|
||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutScrollPerfTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutScrollPerfTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
final Stopwatch clock = Stopwatch()..start();
|
||||
final Process analysis = await startProcess(
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createEmbeddedAndroidViewsIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createExternalUiIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createExternalUiIntegrationTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
||||
@@ -13,11 +13,11 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
|
||||
Future<void> testReload(Process process, { Future<void> Function() onListening }) async {
|
||||
section('Testing hot reload, restart and quit');
|
||||
final Completer<Null> listening = Completer<Null>();
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<Null> reloaded = Completer<Null>();
|
||||
final Completer<Null> restarted = Completer<Null>();
|
||||
final Completer<Null> finished = Completer<Null>();
|
||||
final Completer<void> listening = Completer<void>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
final Completer<void> reloaded = Completer<void>();
|
||||
final Completer<void> restarted = Completer<void>();
|
||||
final Completer<void> finished = Completer<void>();
|
||||
final List<String> stdout = <String>[];
|
||||
final List<String> stderr = <String>[];
|
||||
|
||||
@@ -52,7 +52,7 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
|
||||
|
||||
process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
|
||||
|
||||
Future<dynamic> eventOrExit(Future<Null> event) {
|
||||
Future<dynamic> eventOrExit(Future<void> event) {
|
||||
return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void main() {
|
||||
});
|
||||
|
||||
// Give the device the time to really shut down the app.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 200));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 200));
|
||||
// After the delay, force-stopping it shouldn't do anything, but doesn't hurt.
|
||||
await device.shellExec('am', <String>['force-stop', kAppId]);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class BackButtonMemoryTest extends MemoryTest {
|
||||
await receivedNextMessage;
|
||||
|
||||
// Give Android time to settle (e.g. run GCs) after closing the app.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
// Relaunch the app, wait for it to launch.
|
||||
prepareForNextMessage('READY');
|
||||
@@ -46,13 +46,13 @@ class BackButtonMemoryTest extends MemoryTest {
|
||||
await receivedNextMessage;
|
||||
|
||||
// Wait for the Flutter app to settle (e.g. run GCs).
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
await recordEnd();
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(BackButtonMemoryTest().run);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(MemoryTest(
|
||||
'${flutterDirectory.path}/examples/flutter_gallery',
|
||||
'test_memory/memory_nav.dart',
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() async {
|
||||
final TaskResult withoutSemantics = await createGalleryTransitionTest()();
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
// with the Java code to report its status. If this test fails due to a problem on the Dart
|
||||
// side, you can debug that by just running that file directly using `flutter run`.
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
|
||||
await task(() async {
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterViewStartupTest());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() async {
|
||||
final Directory iosDirectory = dir(
|
||||
|
||||
@@ -166,7 +166,7 @@ class FlutterProject {
|
||||
String get rootPath => path.join(parent.path, name);
|
||||
String get androidPath => path.join(rootPath, 'android');
|
||||
|
||||
Future<Null> addCustomBuildType(String name, {String initWith}) async {
|
||||
Future<void> addCustomBuildType(String name, {String initWith}) async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
@@ -183,7 +183,7 @@ android {
|
||||
''');
|
||||
}
|
||||
|
||||
Future<Null> addProductFlavor(String name) async {
|
||||
Future<void> addProductFlavor(String name) async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
@@ -202,14 +202,14 @@ android {
|
||||
''');
|
||||
}
|
||||
|
||||
Future<Null> introduceError() async {
|
||||
Future<void> introduceError() async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
await buildScript.writeAsString((await buildScript.readAsString()).replaceAll('buildTypes', 'builTypes'));
|
||||
}
|
||||
|
||||
Future<Null> runGradleTask(String task, {List<String> options}) async {
|
||||
Future<void> runGradleTask(String task, {List<String> options}) async {
|
||||
return _runGradleTask(workingDirectory: androidPath, task: task, options: options);
|
||||
}
|
||||
|
||||
@@ -244,14 +244,14 @@ class FlutterPluginProject {
|
||||
String get exampleAndroidPath => path.join(examplePath, 'android');
|
||||
String get debugApkPath => path.join(examplePath, 'build', 'app', 'outputs', 'apk', 'debug', 'app-debug.apk');
|
||||
|
||||
Future<Null> runGradleTask(String task, {List<String> options}) async {
|
||||
Future<void> runGradleTask(String task, {List<String> options}) async {
|
||||
return _runGradleTask(workingDirectory: exampleAndroidPath, task: task, options: options);
|
||||
}
|
||||
|
||||
bool get hasDebugApk => File(debugApkPath).existsSync();
|
||||
}
|
||||
|
||||
Future<Null> _runGradleTask({String workingDirectory, String task, List<String> options}) async {
|
||||
Future<void> _runGradleTask({String workingDirectory, String task, List<String> options}) async {
|
||||
final ProcessResult result = await _resultOfGradleTask(
|
||||
workingDirectory: workingDirectory,
|
||||
task: task,
|
||||
|
||||
@@ -27,13 +27,13 @@ class HelloWorldMemoryTest extends MemoryTest {
|
||||
'-d', device.deviceId,
|
||||
test,
|
||||
]);
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 1500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 1500));
|
||||
await recordStart();
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 3000));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 3000));
|
||||
await recordEnd();
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(HelloWorldMemoryTest().run);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createHelloWorldCompileTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createHelloWorldCompileTest());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// End to end tests for Android.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(runEndToEndTests);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// End to end tests for iOS.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(runEndToEndTests);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/sample_catalog_generator.dart';
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() => samplePageCatalogGenerator(extractCloudAuthTokenArg(args)));
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';
|
||||
|
||||
/// Runs microbenchmarks on Android.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createMicrobenchmarkTask());
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';
|
||||
|
||||
/// Runs microbenchmarks on iOS.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createMicrobenchmarkTask());
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing Android app.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
|
||||
section('Find Java');
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing iOS app.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
|
||||
section('Create Flutter module project');
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformInteractionTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformInteractionTest());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformViewStartupTest());
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() async {
|
||||
final Directory iosDirectory = dir(
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('apk', <String>['-a', 'java']),
|
||||
PluginTest('apk', <String>['-a', 'kotlin']),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('ios', <String>['-i', 'objc']),
|
||||
PluginTest('ios', <String>['-i', 'swift']),
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('apk', <String>['-a', 'java']),
|
||||
PluginTest('apk', <String>['-a', 'kotlin']),
|
||||
|
||||
@@ -29,7 +29,7 @@ void main() {
|
||||
});
|
||||
section('TEST WHETHER `flutter run --route` WORKS');
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
||||
@@ -39,7 +39,7 @@ void main() {
|
||||
final Directory appDir =
|
||||
dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a task that fails by returning an unsuccessful response.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.failure('Failed');
|
||||
});
|
||||
|
||||
@@ -10,4 +10,4 @@ import 'dart:async';
|
||||
/// therefore will not accept requests to run tasks. When the runner attempts to
|
||||
/// connect and run the test it will receive a "method not found" error from the
|
||||
/// VM service, will likely retry and finally time out.
|
||||
Future<Null> main() async {}
|
||||
Future<void> main() async {}
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a successful task.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.success(<String, dynamic>{});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a task that fails with an exception.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
throw 'failed';
|
||||
});
|
||||
|
||||
@@ -76,7 +76,7 @@ Future<int> countDependencies() async {
|
||||
const String _kCostBenchmarkKey = 'technical_debt_in_dollars';
|
||||
const String _kNumberOfDependenciesKey = 'dependencies_count';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.success(
|
||||
<String, dynamic>{
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createTilesScrollPerfTest());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ abstract class DeviceDiscovery {
|
||||
///
|
||||
/// Calling this method does not guarantee that the same device will be
|
||||
/// returned. For such behavior see [workingDevice].
|
||||
Future<Null> chooseWorkingDevice();
|
||||
Future<void> chooseWorkingDevice();
|
||||
|
||||
/// A device to work with.
|
||||
///
|
||||
@@ -55,7 +55,7 @@ abstract class DeviceDiscovery {
|
||||
Future<Map<String, HealthCheckResult>> checkDevices();
|
||||
|
||||
/// Prepares the system to run tasks.
|
||||
Future<Null> performPreflightTasks();
|
||||
Future<void> performPreflightTasks();
|
||||
}
|
||||
|
||||
/// A proxy for one specific device.
|
||||
@@ -70,21 +70,21 @@ abstract class Device {
|
||||
Future<bool> isAsleep();
|
||||
|
||||
/// Wake up the device if it is not awake.
|
||||
Future<Null> wakeUp();
|
||||
Future<void> wakeUp();
|
||||
|
||||
/// Send the device to sleep mode.
|
||||
Future<Null> sendToSleep();
|
||||
Future<void> sendToSleep();
|
||||
|
||||
/// Emulates pressing the power button, toggling the device's on/off state.
|
||||
Future<Null> togglePower();
|
||||
Future<void> togglePower();
|
||||
|
||||
/// Unlocks the device.
|
||||
///
|
||||
/// Assumes the device doesn't have a secure unlock pattern.
|
||||
Future<Null> unlock();
|
||||
Future<void> unlock();
|
||||
|
||||
/// Emulate a tap on the touch screen.
|
||||
Future<Null> tap(int x, int y);
|
||||
Future<void> tap(int x, int y);
|
||||
|
||||
/// Read memory statistics for a process.
|
||||
Future<Map<String, dynamic>> getMemoryStats(String packageName);
|
||||
@@ -96,7 +96,7 @@ abstract class Device {
|
||||
Stream<String> get logcat;
|
||||
|
||||
/// Stop a process.
|
||||
Future<Null> stop(String packageName);
|
||||
Future<void> stop(String packageName);
|
||||
}
|
||||
|
||||
class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
@@ -127,7 +127,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
/// Picks a random Android device out of connected devices and sets it as
|
||||
/// [workingDevice].
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
Future<void> chooseWorkingDevice() async {
|
||||
final List<Device> allDevices = (await discoverDevices())
|
||||
.map<Device>((String id) => AndroidDevice(deviceId: id))
|
||||
.toList();
|
||||
@@ -187,7 +187,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> performPreflightTasks() async {
|
||||
Future<void> performPreflightTasks() async {
|
||||
// Kills the `adb` server causing it to start a new instance upon next
|
||||
// command.
|
||||
//
|
||||
@@ -218,14 +218,14 @@ class AndroidDevice implements Device {
|
||||
|
||||
/// Wake up the device if it is not awake using [togglePower].
|
||||
@override
|
||||
Future<Null> wakeUp() async {
|
||||
Future<void> wakeUp() async {
|
||||
if (!(await isAwake()))
|
||||
await togglePower();
|
||||
}
|
||||
|
||||
/// Send the device to sleep mode if it is not asleep using [togglePower].
|
||||
@override
|
||||
Future<Null> sendToSleep() async {
|
||||
Future<void> sendToSleep() async {
|
||||
if (!(await isAsleep()))
|
||||
await togglePower();
|
||||
}
|
||||
@@ -233,7 +233,7 @@ class AndroidDevice implements Device {
|
||||
/// Sends `KEYCODE_POWER` (26), which causes the device to toggle its mode
|
||||
/// between awake and asleep.
|
||||
@override
|
||||
Future<Null> togglePower() async {
|
||||
Future<void> togglePower() async {
|
||||
await shellExec('input', const <String>['keyevent', '26']);
|
||||
}
|
||||
|
||||
@@ -241,13 +241,13 @@ class AndroidDevice implements Device {
|
||||
///
|
||||
/// This only works when the device doesn't have a secure unlock pattern.
|
||||
@override
|
||||
Future<Null> unlock() async {
|
||||
Future<void> unlock() async {
|
||||
await wakeUp();
|
||||
await shellExec('input', const <String>['keyevent', '82']);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> tap(int x, int y) async {
|
||||
Future<void> tap(int x, int y) async {
|
||||
await shellExec('input', <String>['tap', '$x', '$y']);
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ class AndroidDevice implements Device {
|
||||
}
|
||||
|
||||
/// Executes [command] on `adb shell` and returns its exit code.
|
||||
Future<Null> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
Future<void> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
await adb(<String>['shell', command]..addAll(arguments), environment: environment);
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ class AndroidDevice implements Device {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> stop(String packageName) async {
|
||||
Future<void> stop(String packageName) async {
|
||||
return shellExec('am', <String>['force-stop', packageName]);
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
/// Picks a random iOS device out of connected devices and sets it as
|
||||
/// [workingDevice].
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
Future<void> chooseWorkingDevice() async {
|
||||
final List<IosDevice> allDevices = (await discoverDevices())
|
||||
.map<IosDevice>((String id) => IosDevice(deviceId: id))
|
||||
.toList();
|
||||
@@ -405,7 +405,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> performPreflightTasks() async {
|
||||
Future<void> performPreflightTasks() async {
|
||||
// Currently we do not have preflight tasks for iOS.
|
||||
return null;
|
||||
}
|
||||
@@ -430,19 +430,19 @@ class IosDevice implements Device {
|
||||
Future<bool> isAsleep() async => false;
|
||||
|
||||
@override
|
||||
Future<Null> wakeUp() async {}
|
||||
Future<void> wakeUp() async {}
|
||||
|
||||
@override
|
||||
Future<Null> sendToSleep() async {}
|
||||
Future<void> sendToSleep() async {}
|
||||
|
||||
@override
|
||||
Future<Null> togglePower() async {}
|
||||
Future<void> togglePower() async {}
|
||||
|
||||
@override
|
||||
Future<Null> unlock() async {}
|
||||
Future<void> unlock() async {}
|
||||
|
||||
@override
|
||||
Future<Null> tap(int x, int y) async {
|
||||
Future<void> tap(int x, int y) async {
|
||||
throw 'Not implemented';
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ class IosDevice implements Device {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> stop(String packageName) async {}
|
||||
Future<void> stop(String packageName) async {}
|
||||
}
|
||||
|
||||
/// Path to the `adb` executable.
|
||||
|
||||
@@ -19,7 +19,7 @@ const FileSystem _fs = io.LocalFileSystem();
|
||||
/// 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 {
|
||||
Future<void> prepareProvisioningCertificates(String flutterProjectPath) async {
|
||||
final String certificateConfig = await _readProvisioningConfigFile();
|
||||
if (certificateConfig == null) {
|
||||
// No cert config available, rely on automatic signing by Xcode.
|
||||
@@ -31,12 +31,12 @@ Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
|
||||
await testXcconfig.writeAsString(certificateConfig);
|
||||
}
|
||||
|
||||
Future<Null> runPodInstallForCustomPodfile(String flutterProjectPath) async {
|
||||
Future<void> runPodInstallForCustomPodfile(String flutterProjectPath) async {
|
||||
final String iosPath = path.join(flutterProjectPath, 'ios');
|
||||
exec('pod', <String>['install', '--project-directory=$iosPath']);
|
||||
}
|
||||
|
||||
Future<Null> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
Future<void> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
final List<File> xcconfigFiles = <File>[
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
|
||||
|
||||
@@ -97,7 +97,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
// delay to let the task process open up the VM service port.
|
||||
// Otherwise we almost always hit the non-ready case first and
|
||||
// wait a whole 1 second, which is annoying.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
@@ -123,7 +123,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
print('VM service not ready yet: $error');
|
||||
const Duration pauseBetweenRetries = Duration(milliseconds: 200);
|
||||
print('Will retry in $pauseBetweenRetries.');
|
||||
await Future<Null>.delayed(pauseBetweenRetries);
|
||||
await Future<void>.delayed(pauseBetweenRetries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -243,12 +243,12 @@ Future<Process> startProcess(
|
||||
return process;
|
||||
}
|
||||
|
||||
Future<Null> forceQuitRunningProcesses() async {
|
||||
Future<void> forceQuitRunningProcesses() async {
|
||||
if (_runningProcesses.isEmpty)
|
||||
return;
|
||||
|
||||
// Give normally quitting processes a chance to report their exit code.
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
// Whatever's left, kill it.
|
||||
for (ProcessInfo p in _runningProcesses) {
|
||||
@@ -270,8 +270,8 @@ Future<int> exec(
|
||||
}) async {
|
||||
final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory);
|
||||
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@@ -285,7 +285,7 @@ Future<int> exec(
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
|
||||
await Future.wait<Null>(<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
final int exitCode = await process.exitCode;
|
||||
|
||||
if (exitCode != 0 && !canFail)
|
||||
@@ -307,8 +307,8 @@ Future<String> eval(
|
||||
final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory);
|
||||
|
||||
final StringBuffer output = StringBuffer();
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@@ -323,7 +323,7 @@ Future<String> eval(
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
|
||||
await Future.wait<Null>(<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
final int exitCode = await process.exitCode;
|
||||
|
||||
if (exitCode != 0 && !canFail)
|
||||
@@ -420,7 +420,7 @@ String jsonEncode(dynamic data) {
|
||||
return const JsonEncoder.withIndent(' ').convert(data) + '\n';
|
||||
}
|
||||
|
||||
Future<Null> getFlutter(String revision) async {
|
||||
Future<void> getFlutter(String revision) async {
|
||||
section('Get Flutter!');
|
||||
|
||||
if (exists(flutterDirectory)) {
|
||||
@@ -495,8 +495,8 @@ Iterable<String> grep(Pattern pattern, {@required String from}) {
|
||||
/// } catch (error, chain) {
|
||||
///
|
||||
/// }
|
||||
Future<Null> runAndCaptureAsyncStacks(Future<Null> callback()) {
|
||||
final Completer<Null> completer = Completer<Null>();
|
||||
Future<void> runAndCaptureAsyncStacks(Future<void> callback()) {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
Chain.capture(() async {
|
||||
await callback();
|
||||
completer.complete();
|
||||
|
||||
@@ -43,8 +43,8 @@ TaskFunction createHotModeTest() {
|
||||
environment: null
|
||||
);
|
||||
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@@ -80,8 +80,8 @@ TaskFunction createHotModeTest() {
|
||||
stderrDone.complete();
|
||||
});
|
||||
|
||||
await Future.wait<Null>(
|
||||
<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(
|
||||
<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
await process.exitCode;
|
||||
|
||||
twoReloadsData = json.decode(benchmarkFile.readAsStringSync());
|
||||
@@ -96,8 +96,8 @@ TaskFunction createHotModeTest() {
|
||||
<String>['run']..addAll(options),
|
||||
environment: null
|
||||
);
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@@ -118,8 +118,8 @@ TaskFunction createHotModeTest() {
|
||||
stderrDone.complete();
|
||||
});
|
||||
|
||||
await Future.wait<Null>(
|
||||
<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(
|
||||
<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
await process.exitCode;
|
||||
|
||||
freshRestartReloadsData =
|
||||
|
||||
@@ -73,7 +73,7 @@ class FlutterProject {
|
||||
|
||||
String get rootPath => path.join(parent.path, name);
|
||||
|
||||
Future<Null> addPlugin(String plugin) async {
|
||||
Future<void> addPlugin(String plugin) async {
|
||||
final File pubspec = File(path.join(rootPath, 'pubspec.yaml'));
|
||||
String content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
@@ -83,13 +83,13 @@ class FlutterProject {
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
}
|
||||
|
||||
Future<Null> build(String target) async {
|
||||
Future<void> build(String target) async {
|
||||
await inDirectory(Directory(rootPath), () async {
|
||||
await flutter('build', options: <String>[target]);
|
||||
});
|
||||
}
|
||||
|
||||
Future<Null> delete() async {
|
||||
Future<void> delete() async {
|
||||
if (Platform.isWindows) {
|
||||
// A running Gradle daemon might prevent us from deleting the project
|
||||
// folder on Windows.
|
||||
@@ -99,7 +99,7 @@ class FlutterProject {
|
||||
canFail: true,
|
||||
);
|
||||
// TODO(ianh): Investigating if flakiness is timing dependent.
|
||||
await Future<Null>.delayed(const Duration(seconds: 10));
|
||||
await Future<void>.delayed(const Duration(seconds: 10));
|
||||
}
|
||||
rmTree(parent);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ class Upload {
|
||||
final HttpClientResponse response = await request.close().timeout(timeLimit);
|
||||
if (response.statusCode == HttpStatus.ok) {
|
||||
logMessage('Saved $name');
|
||||
await response.drain<Null>();
|
||||
await response.drain<void>();
|
||||
} 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');
|
||||
@@ -93,7 +93,7 @@ class Upload {
|
||||
static bool isNotComplete(Upload upload) => !upload.isComplete;
|
||||
}
|
||||
|
||||
Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
|
||||
Future<void> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
|
||||
assert(fromPaths.length == largeNames.length);
|
||||
assert(fromPaths.length == smallNames.length);
|
||||
|
||||
@@ -113,7 +113,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
|
||||
// If path is lib/foo.png then screenshotName is foo.
|
||||
String screenshotName(String path) => basenameWithoutExtension(path);
|
||||
|
||||
Future<Null> saveCatalogScreenshots({
|
||||
Future<void> saveCatalogScreenshots({
|
||||
Directory directory, // Where the *.png screenshots are.
|
||||
String commit, // The commit hash to be used as a cloud storage "directory".
|
||||
String token, // Cloud storage authorization token.
|
||||
|
||||
@@ -192,7 +192,7 @@ class FakeDevice extends AndroidDevice {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
Future<void> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
commandLog.add(CommandArgs(
|
||||
command: command,
|
||||
arguments: arguments,
|
||||
|
||||
Reference in New Issue
Block a user