Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
<Null> -> <void>
  • Loading branch information
stuartmorgan-g committed Apr 1, 2021
commit b80b3baa9d316d9a1aba9d933e9d232fb5248867
2 changes: 1 addition & 1 deletion script/tool/lib/src/analyze_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AnalyzeCommand extends PluginCommand {
'This command requires "pub" and "flutter" to be in your path.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();

print('Verifying analysis settings...');
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/build_examples_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class BuildExamplesCommand extends PluginCommand {
'This command requires "flutter" to be in your path.';

@override
Future<Null> run() async {
Future<void> run() async {
final List<String> platformSwitches = <String>[
kApk,
kIpa,
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class ToolExit extends Error {
final int exitCode;
}

abstract class PluginCommand extends Command<Null> {
abstract class PluginCommand extends Command<void> {
PluginCommand(
this.packagesDir,
this.fileSystem, {
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/create_all_plugins_app_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CreateAllPluginsAppCommand extends PluginCommand {
String get name => 'all-plugins-app';

@override
Future<Null> run() async {
Future<void> run() async {
final int exitCode = await _createApp();
if (exitCode != 0) {
throw ToolExit(exitCode);
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/drive_examples_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DriveExamplesCommand extends PluginCommand {
'integration_test/*_test.dart.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final List<String> failingTests = <String>[];
final bool isLinux = argResults[kLinux] == true;
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/firebase_test_lab_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class FirebaseTestLabCommand extends PluginCommand {
}

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final Stream<Directory> packagesWithTests = getPackages().where(
(Directory d) =>
Expand Down
8 changes: 4 additions & 4 deletions script/tool/lib/src/format_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FormatCommand extends PluginCommand {
'your path.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final String googleFormatterPath = await _getGoogleFormatterPath();

Expand Down Expand Up @@ -82,7 +82,7 @@ class FormatCommand extends PluginCommand {
return true;
}

Future<Null> _formatCppAndObjectiveC() async {
Future<void> _formatCppAndObjectiveC() async {
print('Formatting all .cc, .cpp, .mm, .m, and .h files...');
final Iterable<String> allFiles = <String>[]
..addAll(await _getFilesWithExtension('.h'))
Expand All @@ -100,15 +100,15 @@ class FormatCommand extends PluginCommand {
}
}

Future<Null> _formatJava(String googleFormatterPath) async {
Future<void> _formatJava(String googleFormatterPath) async {
print('Formatting all .java files...');
final Iterable<String> javaFiles = await _getFilesWithExtension('.java');
await processRunner.runAndStream('java',
<String>['-jar', googleFormatterPath, '--replace']..addAll(javaFiles),
workingDir: packagesDir, exitOnError: true);
}

Future<Null> _formatDart() async {
Future<void> _formatDart() async {
// This actually should be fine for non-Flutter Dart projects, no need to
// specifically shell out to dartfmt -w in that case.
print('Formatting all .dart files...');
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/java_test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JavaTestCommand extends PluginCommand {
static const String _gradleWrapper = 'gradlew';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final Stream<Directory> examplesWithTests = getExamples().where(
(Directory d) =>
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/license_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class LicenseCheckCommand extends PluginCommand {
'Ensures that all code files have copyright/license blocks.';

@override
Future<Null> run() async {
Future<void> run() async {
final Iterable<File> codeFiles = (await _getAllFiles()).where((File file) =>
_codeFileExtensions.contains(p.extension(file.path)) &&
!_shouldIgnoreFile(file));
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/lint_podspecs_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class LintPodspecsCommand extends PluginCommand {
final Print _print;

@override
Future<Null> run() async {
Future<void> run() async {
if (!platform.isMacOS) {
_print('Detected platform is not macOS, skipping podspec lint');
return;
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/list_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ListCommand extends PluginCommand {
final String description = 'Lists packages or files';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
switch (argResults[_type] as String) {
case _plugin:
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main(List<String> args) {
}
}

final CommandRunner<Null> commandRunner = CommandRunner<Null>(
final CommandRunner<void> commandRunner = CommandRunner<void>(
'pub global run flutter_plugin_tools',
'Productivity utils for hosting multiple plugins within one repository.')
..addCommand(AnalyzeCommand(packagesDir, fileSystem))
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/publish_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PublishCheckCommand extends PluginCommand {
'Checks to make sure that a plugin *could* be published.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final List<Directory> failedPackages = <Directory>[];

Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/publish_plugin_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class PublishPluginCommand extends PluginCommand {
StreamSubscription<String> _stdinSubscription;

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
_print('Checking local repo...');
_packageDir = _checkPackageDir();
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/test_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestCommand extends PluginCommand {
'This command requires "flutter" to be in your path.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final List<String> failingPackages = <String>[];
await for (Directory packageDir in getPackages()) {
Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/version_check_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class VersionCheckCommand extends PluginCommand {
'This command requires "pub" and "flutter" to be in your path.';

@override
Future<Null> run() async {
Future<void> run() async {
checkSharding();
final GitVersionFinder gitVersionFinder = await retrieveVersionFinder();

Expand Down
2 changes: 1 addition & 1 deletion script/tool/lib/src/xctest_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class XCTestCommand extends PluginCommand {
'This command requires "flutter" and "xcrun" to be in your path.';

@override
Future<Null> run() async {
Future<void> run() async {
String destination = argResults[_kiOSDestination] as String;
if (destination == null) {
String simulatorId = await _findAvailableIphoneSimulator();
Expand Down
2 changes: 1 addition & 1 deletion script/tool/test/analyze_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void main() {
mockPackagesDir, mockFileSystem,
processRunner: processRunner);

runner = CommandRunner<Null>('analyze_command', 'Test for analyze_command');
runner = CommandRunner<void>('analyze_command', 'Test for analyze_command');
runner.addCommand(analyzeCommand);
});

Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/build_examples_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'util.dart';

void main() {
group('test build_example_command', () {
CommandRunner<Null> runner;
CommandRunner<void> runner;
RecordingProcessRunner processRunner;
final String flutterCommand =
LocalPlatform().isWindows ? 'flutter.bat' : 'flutter';
Expand All @@ -25,7 +25,7 @@ void main() {
mockPackagesDir, mockFileSystem,
processRunner: processRunner);

runner = CommandRunner<Null>(
runner = CommandRunner<void>(
'build_examples_command', 'Test for build_example_command');
runner.addCommand(command);
cleanupPackages();
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/common_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() {
gitDir: gitDir,
);
runner =
CommandRunner<Null>('common_command', 'Test for common functionality');
CommandRunner<void>('common_command', 'Test for common functionality');
runner.addCommand(samplePluginCommand);
});

Expand Down Expand Up @@ -320,7 +320,7 @@ class SamplePluginCommand extends PluginCommand {
final String description = 'sample command';

@override
Future<Null> run() async {
Future<void> run() async {
await for (Directory package in getPlugins()) {
this.plugins_.add(package.path);
}
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/create_all_plugins_app_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'util.dart';

void main() {
group('$CreateAllPluginsAppCommand', () {
CommandRunner<Null> runner;
CommandRunner<void> runner;
FileSystem fileSystem;
Directory testRoot;
Directory packagesDir;
Expand All @@ -32,7 +32,7 @@ void main() {
pluginsRoot: testRoot,
);
appDir = command.appDirectory;
runner = CommandRunner<Null>(
runner = CommandRunner<void>(
'create_all_test', 'Test for $CreateAllPluginsAppCommand');
runner.addCommand(command);
});
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/drive_examples_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import 'util.dart';

void main() {
group('test drive_example_command', () {
CommandRunner<Null> runner;
CommandRunner<void> runner;
RecordingProcessRunner processRunner;
final String flutterCommand =
LocalPlatform().isWindows ? 'flutter.bat' : 'flutter';
Expand All @@ -25,7 +25,7 @@ void main() {
mockPackagesDir, mockFileSystem,
processRunner: processRunner);

runner = CommandRunner<Null>(
runner = CommandRunner<void>(
'drive_examples_command', 'Test for drive_example_command');
runner.addCommand(command);
});
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/firebase_test_lab_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'util.dart';
void main() {
group('$FirebaseTestLabCommand', () {
final List<String> printedMessages = <String>[];
CommandRunner<FirebaseTestLabCommand> runner;
CommandRunner<void> runner;
RecordingProcessRunner processRunner;

setUp(() {
Expand All @@ -26,7 +26,7 @@ void main() {
processRunner: processRunner,
print: (Object message) => printedMessages.add(message.toString()));

runner = CommandRunner<Null>(
runner = CommandRunner<void>(
'firebase_test_lab_command', 'Test for $FirebaseTestLabCommand');
runner.addCommand(command);
});
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/java_test_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import 'util.dart';

void main() {
group('$JavaTestCommand', () {
CommandRunner<JavaTestCommand> runner;
CommandRunner<void> runner;
final RecordingProcessRunner processRunner = RecordingProcessRunner();

setUp(() {
Expand All @@ -22,7 +22,7 @@ void main() {
processRunner: processRunner);

runner =
CommandRunner<Null>('java_test_test', 'Test for $JavaTestCommand');
CommandRunner<void>('java_test_test', 'Test for $JavaTestCommand');
runner.addCommand(command);
});

Expand Down
18 changes: 10 additions & 8 deletions script/tool/test/license_check_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:test/test.dart';

void main() {
group('$LicenseCheckCommand', () {
CommandRunner<Null> runner;
CommandRunner<void> runner;
FileSystem fileSystem;
List<String> printedMessages;
Directory root;
Expand All @@ -29,7 +29,7 @@ void main() {
print: (Object message) => printedMessages.add(message.toString()),
);
runner =
CommandRunner<Null>('license_test', 'Test for $LicenseCheckCommand');
CommandRunner<void>('license_test', 'Test for $LicenseCheckCommand');
runner.addCommand(command);
});

Expand Down Expand Up @@ -304,18 +304,20 @@ void main() {
_writeLicense(
bad,
copyright: 'Copyright 2017 Some New Authors.',
license: <String>[
'Licensed under the Apache License, Version 2.0 (the "License");',
'you may not use this file except in compliance with the License.'
],
license: <String>[
'Licensed under the Apache License, Version 2.0 (the "License");',
'you may not use this file except in compliance with the License.'
],
);

await expectLater(() => runner.run(<String>['license-check']),
throwsA(const TypeMatcher<ToolExit>()));

// Failure should give information about the problematic files.
expect(printedMessages,
contains('No recognized license was found for the following third-party files:'));
expect(
printedMessages,
contains(
'No recognized license was found for the following third-party files:'));
expect(printedMessages, contains(' third_party/bad.cc'));
// Failure shouldn't print the success message.
expect(printedMessages,
Expand Down
10 changes: 4 additions & 6 deletions script/tool/test/lint_podspecs_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import 'util.dart';

void main() {
group('$LintPodspecsCommand', () {
CommandRunner<Null> runner;
CommandRunner<void> runner;
MockPlatform mockPlatform;
final RecordingProcessRunner processRunner = RecordingProcessRunner();
List<String> printedMessages;
Expand All @@ -37,7 +37,7 @@ void main() {
);

runner =
CommandRunner<Null>('podspec_test', 'Test for $LintPodspecsCommand');
CommandRunner<void>('podspec_test', 'Test for $LintPodspecsCommand');
runner.addCommand(command);
final MockProcess mockLintProcess = MockProcess();
mockLintProcess.exitCodeCompleter.complete(0);
Expand Down Expand Up @@ -103,8 +103,7 @@ void main() {
]),
);

expect(
printedMessages, contains('Linting plugin1.podspec'));
expect(printedMessages, contains('Linting plugin1.podspec'));
expect(printedMessages, contains('Foo'));
expect(printedMessages, contains('Bar'));
});
Expand Down Expand Up @@ -166,8 +165,7 @@ void main() {
]),
);

expect(
printedMessages, contains('Linting plugin1.podspec'));
expect(printedMessages, contains('Linting plugin1.podspec'));
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions script/tool/test/list_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import 'util.dart';

void main() {
group('$ListCommand', () {
CommandRunner<ListCommand> runner;
CommandRunner<void> runner;

setUp(() {
initializeFakePackages();
final ListCommand command = ListCommand(mockPackagesDir, mockFileSystem);

runner = CommandRunner<Null>('list_test', 'Test for $ListCommand');
runner = CommandRunner<void>('list_test', 'Test for $ListCommand');
runner.addCommand(command);
});

Expand Down
Loading