Add pubspec convention checks (#3984)

This commit is contained in:
stuartmorgan
2021-05-27 20:54:06 -07:00
committed by GitHub
parent 93047fff2f
commit d21b1d9706
7 changed files with 529 additions and 32 deletions

View File

@ -9,8 +9,6 @@ import 'dart:io' as io;
import 'package:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:flutter_plugin_tools/src/publish_check_command.dart';
import 'package:flutter_plugin_tools/src/publish_plugin_command.dart';
import 'package:path/path.dart' as p;
import 'analyze_command.dart';
@ -24,6 +22,9 @@ import 'java_test_command.dart';
import 'license_check_command.dart';
import 'lint_podspecs_command.dart';
import 'list_command.dart';
import 'publish_check_command.dart';
import 'publish_plugin_command.dart';
import 'pubspec_check_command.dart';
import 'test_command.dart';
import 'version_check_command.dart';
import 'xctest_command.dart';
@ -58,12 +59,20 @@ void main(List<String> args) {
..addCommand(ListCommand(packagesDir, fileSystem))
..addCommand(PublishCheckCommand(packagesDir, fileSystem))
..addCommand(PublishPluginCommand(packagesDir, fileSystem))
..addCommand(PubspecCheckCommand(packagesDir, fileSystem))
..addCommand(TestCommand(packagesDir, fileSystem))
..addCommand(VersionCheckCommand(packagesDir, fileSystem))
..addCommand(XCTestCommand(packagesDir, fileSystem));
commandRunner.run(args).catchError((Object e) {
final ToolExit toolExit = e as ToolExit;
io.exit(toolExit.exitCode);
int exitCode = toolExit.exitCode;
// This should never happen; this check is here to guarantee that a ToolExit
// never accidentally has code 0 thus causing CI to pass.
if (exitCode == 0) {
assert(false);
exitCode = 255;
}
io.exit(exitCode);
}, test: (Object e) => e is ToolExit);
}