mirror of
https://github.com/flutter/packages.git
synced 2025-06-05 19:17:51 +08:00
[tool] Clean up "plugin" references (#6503)
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
## 0.11
|
||||
|
||||
* Renames `publish-plugin` to `publish`.
|
||||
* Renames arguments to `list`:
|
||||
* `--package` now lists top-level packages (previously `--plugin`).
|
||||
* `--package-or-subpackage` now lists top-level packages (previously
|
||||
`--package`).
|
||||
|
||||
## 0.10.0+1
|
||||
|
||||
* Recognizes `run_test.sh` as a developer-only file in `version-check`.
|
||||
|
@ -54,7 +54,7 @@ dart pub global run flutter_plugin_tools <args>
|
||||
## Commands
|
||||
|
||||
Run with `--help` for a full list of commands and arguments, but the
|
||||
following shows a number of common commands being run for a specific plugin.
|
||||
following shows a number of common commands being run for a specific package.
|
||||
|
||||
All examples assume running from source; see above for running the
|
||||
published version instead.
|
||||
@ -71,29 +71,29 @@ command is targetting. An package name can be any of:
|
||||
|
||||
```sh
|
||||
cd <repository root>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart format --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart format --packages package_name
|
||||
```
|
||||
|
||||
### Run the Dart Static Analyzer
|
||||
|
||||
```sh
|
||||
cd <repository root>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart analyze --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart analyze --packages package_name
|
||||
```
|
||||
|
||||
### Run Dart Unit Tests
|
||||
|
||||
```sh
|
||||
cd <repository root>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart test --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart test --packages package_name
|
||||
```
|
||||
|
||||
### Run Dart Integration Tests
|
||||
|
||||
```sh
|
||||
cd <repository root>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart build-examples --apk --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart drive-examples --android --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart build-examples --apk --packages package_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart drive-examples --android --packages package_name
|
||||
```
|
||||
|
||||
Replace `--apk`/`--android` with the platform you want to test against
|
||||
@ -110,11 +110,11 @@ Examples:
|
||||
```sh
|
||||
cd <repository root>
|
||||
# Run just unit tests for iOS and Android:
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --ios --android --no-integration --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --ios --android --no-integration --packages package_name
|
||||
# Run all tests for macOS:
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --macos --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --macos --packages package_name
|
||||
# Run all tests for Windows:
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --windows --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart native-test --windows --packages package_name
|
||||
```
|
||||
|
||||
### Update README.md from Example Sources
|
||||
@ -125,7 +125,7 @@ before running this command.
|
||||
|
||||
```sh
|
||||
cd <repository root>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages plugin_name
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart update-excerpts --packages package_name
|
||||
```
|
||||
|
||||
### Update CHANGELOG and Version
|
||||
@ -165,18 +165,18 @@ on the Flutter Wiki first.
|
||||
```sh
|
||||
cd <path_to_plugins>
|
||||
git checkout <commit_hash_to_publish>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart publish-plugin --packages <package>
|
||||
dart run ./script/tool/bin/flutter_plugin_tools.dart publish --packages <package>
|
||||
```
|
||||
|
||||
By default the tool tries to push tags to the `upstream` remote, but some
|
||||
additional settings can be configured. Run `dart run ./script/tool/bin/flutter_plugin_tools.dart
|
||||
publish-plugin --help` for more usage information.
|
||||
publish --help` for more usage information.
|
||||
|
||||
The tool wraps `pub publish` for pushing the package to pub, and then will
|
||||
automatically use git to try to create and push tags. It has some additional
|
||||
safety checking around `pub publish` too. By default `pub publish` publishes
|
||||
_everything_, including untracked or uncommitted files in version control.
|
||||
`publish-plugin` will first check the status of the local
|
||||
`publish` will first check the status of the local
|
||||
directory and refuse to publish if there are any mismatched files with version
|
||||
control present.
|
||||
|
||||
|
@ -34,9 +34,9 @@ class PackageEnumerationEntry {
|
||||
|
||||
/// Interface definition for all commands in this tool.
|
||||
// TODO(stuartmorgan): Move most of this logic to PackageLoopingCommand.
|
||||
abstract class PluginCommand extends Command<void> {
|
||||
abstract class PackageCommand extends Command<void> {
|
||||
/// Creates a command to operate on [packagesDir] with the given environment.
|
||||
PluginCommand(
|
||||
PackageCommand(
|
||||
this.packagesDir, {
|
||||
this.processRunner = const ProcessRunner(),
|
||||
this.platform = const LocalPlatform(),
|
||||
@ -47,7 +47,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
help:
|
||||
'Specifies which packages the command should run on (before sharding).\n',
|
||||
valueHelp: 'package1,package2,...',
|
||||
aliases: <String>[_pluginsArg],
|
||||
aliases: <String>[_pluginsLegacyAliasArg],
|
||||
);
|
||||
argParser.addOption(
|
||||
_shardIndexArg,
|
||||
@ -58,7 +58,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
);
|
||||
argParser.addOption(
|
||||
_shardCountArg,
|
||||
help: 'Specifies the number of shards into which plugins are divided.',
|
||||
help: 'Specifies the number of shards into which packages are divided.',
|
||||
valueHelp: 'n',
|
||||
defaultsTo: '1',
|
||||
);
|
||||
@ -71,7 +71,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
defaultsTo: <String>[],
|
||||
);
|
||||
argParser.addFlag(_runOnChangedPackagesArg,
|
||||
help: 'Run the command on changed packages/plugins.\n'
|
||||
help: 'Run the command on changed packages.\n'
|
||||
'If no packages have changed, or if there have been changes that may\n'
|
||||
'affect all packages, the command runs on all packages.\n'
|
||||
'Packages excluded with $_excludeArg are excluded even if changed.\n'
|
||||
@ -106,13 +106,13 @@ abstract class PluginCommand extends Command<void> {
|
||||
static const String _logTimingArg = 'log-timing';
|
||||
static const String _packagesArg = 'packages';
|
||||
static const String _packagesForBranchArg = 'packages-for-branch';
|
||||
static const String _pluginsArg = 'plugins';
|
||||
static const String _pluginsLegacyAliasArg = 'plugins';
|
||||
static const String _runOnChangedPackagesArg = 'run-on-changed-packages';
|
||||
static const String _runOnDirtyPackagesArg = 'run-on-dirty-packages';
|
||||
static const String _shardCountArg = 'shardCount';
|
||||
static const String _shardIndexArg = 'shardIndex';
|
||||
|
||||
/// The directory containing the plugin packages.
|
||||
/// The directory containing the packages.
|
||||
final Directory packagesDir;
|
||||
|
||||
/// The process runner.
|
||||
@ -221,7 +221,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
_shardCount = shardCount;
|
||||
}
|
||||
|
||||
/// Returns the set of plugins to exclude based on the `--exclude` argument.
|
||||
/// Returns the set of packages to exclude based on the `--exclude` argument.
|
||||
Set<String> getExcludedPackageNames() {
|
||||
final Set<String> excludedPackages = _excludedPackages ??
|
||||
getStringListArg(_excludeArg).expand<String>((String item) {
|
||||
@ -250,22 +250,22 @@ abstract class PluginCommand extends Command<void> {
|
||||
Stream<PackageEnumerationEntry> getTargetPackages(
|
||||
{bool filterExcluded = true}) async* {
|
||||
// To avoid assuming consistency of `Directory.list` across command
|
||||
// invocations, we collect and sort the plugin folders before sharding.
|
||||
// invocations, we collect and sort the package folders before sharding.
|
||||
// This is considered an implementation detail which is why the API still
|
||||
// uses streams.
|
||||
final List<PackageEnumerationEntry> allPlugins =
|
||||
final List<PackageEnumerationEntry> allPackages =
|
||||
await _getAllPackages().toList();
|
||||
allPlugins.sort((PackageEnumerationEntry p1, PackageEnumerationEntry p2) =>
|
||||
allPackages.sort((PackageEnumerationEntry p1, PackageEnumerationEntry p2) =>
|
||||
p1.package.path.compareTo(p2.package.path));
|
||||
final int shardSize = allPlugins.length ~/ shardCount +
|
||||
(allPlugins.length % shardCount == 0 ? 0 : 1);
|
||||
final int start = min(shardIndex * shardSize, allPlugins.length);
|
||||
final int end = min(start + shardSize, allPlugins.length);
|
||||
final int shardSize = allPackages.length ~/ shardCount +
|
||||
(allPackages.length % shardCount == 0 ? 0 : 1);
|
||||
final int start = min(shardIndex * shardSize, allPackages.length);
|
||||
final int end = min(start + shardSize, allPackages.length);
|
||||
|
||||
for (final PackageEnumerationEntry plugin
|
||||
in allPlugins.sublist(start, end)) {
|
||||
if (!(filterExcluded && plugin.excluded)) {
|
||||
yield plugin;
|
||||
for (final PackageEnumerationEntry package
|
||||
in allPackages.sublist(start, end)) {
|
||||
if (!(filterExcluded && package.excluded)) {
|
||||
yield package;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -330,7 +330,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
runOnChangedPackages = false;
|
||||
}
|
||||
|
||||
final Set<String> excludedPluginNames = getExcludedPackageNames();
|
||||
final Set<String> excludedPackageNames = getExcludedPackageNames();
|
||||
|
||||
if (runOnChangedPackages) {
|
||||
final GitVersionFinder gitVersionFinder = await retrieveVersionFinder();
|
||||
@ -368,15 +368,16 @@ abstract class PluginCommand extends Command<void> {
|
||||
]) {
|
||||
await for (final FileSystemEntity entity
|
||||
in dir.list(followLinks: false)) {
|
||||
// A top-level Dart package is a plugin package.
|
||||
// A top-level Dart package is a standard package.
|
||||
if (isPackage(entity)) {
|
||||
if (packages.isEmpty || packages.contains(p.basename(entity.path))) {
|
||||
yield PackageEnumerationEntry(
|
||||
RepositoryPackage(entity as Directory),
|
||||
excluded: excludedPluginNames.contains(entity.basename));
|
||||
excluded: excludedPackageNames.contains(entity.basename));
|
||||
}
|
||||
} else if (entity is Directory) {
|
||||
// Look for Dart packages under this top-level directory.
|
||||
// Look for Dart packages under this top-level directory; this is the
|
||||
// standard structure for federated plugins.
|
||||
await for (final FileSystemEntity subdir
|
||||
in entity.list(followLinks: false)) {
|
||||
if (isPackage(subdir)) {
|
||||
@ -394,7 +395,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
packages.intersection(possibleMatches).isNotEmpty) {
|
||||
yield PackageEnumerationEntry(
|
||||
RepositoryPackage(subdir as Directory),
|
||||
excluded: excludedPluginNames
|
||||
excluded: excludedPackageNames
|
||||
.intersection(possibleMatches)
|
||||
.isNotEmpty);
|
||||
}
|
||||
@ -415,11 +416,12 @@ abstract class PluginCommand extends Command<void> {
|
||||
/// stream.
|
||||
Stream<PackageEnumerationEntry> getTargetPackagesAndSubpackages(
|
||||
{bool filterExcluded = true}) async* {
|
||||
await for (final PackageEnumerationEntry plugin
|
||||
await for (final PackageEnumerationEntry package
|
||||
in getTargetPackages(filterExcluded: filterExcluded)) {
|
||||
yield plugin;
|
||||
yield* getSubpackages(plugin.package).map((RepositoryPackage package) =>
|
||||
PackageEnumerationEntry(package, excluded: plugin.excluded));
|
||||
yield package;
|
||||
yield* getSubpackages(package.package).map(
|
||||
(RepositoryPackage subPackage) =>
|
||||
PackageEnumerationEntry(subPackage, excluded: package.excluded));
|
||||
}
|
||||
}
|
||||
|
||||
@ -524,7 +526,7 @@ abstract class PluginCommand extends Command<void> {
|
||||
}
|
||||
|
||||
// Returns true if one or more files changed that have the potential to affect
|
||||
// any plugin (e.g., CI script changes).
|
||||
// any packages (e.g., CI script changes).
|
||||
bool _changesRequireFullTest(List<String> changedFiles) {
|
||||
const List<String> specialFiles = <String>[
|
||||
'.ci.yaml', // LUCI config.
|
@ -12,7 +12,7 @@ import 'package:platform/platform.dart';
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
|
||||
import 'core.dart';
|
||||
import 'plugin_command.dart';
|
||||
import 'package_command.dart';
|
||||
import 'process_runner.dart';
|
||||
import 'repository_package.dart';
|
||||
|
||||
@ -82,7 +82,7 @@ class PackageResult {
|
||||
/// An abstract base class for a command that iterates over a set of packages
|
||||
/// controlled by a standard set of flags, running some actions on each package,
|
||||
/// and collecting and reporting the success/failure of those actions.
|
||||
abstract class PackageLoopingCommand extends PluginCommand {
|
||||
abstract class PackageLoopingCommand extends PackageCommand {
|
||||
/// Creates a command to operate on [packagesDir] with the given environment.
|
||||
PackageLoopingCommand(
|
||||
Directory packagesDir, {
|
||||
|
@ -161,7 +161,7 @@ bool _isUnpublishedExampleChange(
|
||||
return exampleComponents.first.toLowerCase() != 'readme.md';
|
||||
}
|
||||
|
||||
// True if the change is only relevant to people working on the plugin.
|
||||
// True if the change is only relevant to people working on the package.
|
||||
Future<bool> _isDevChange(List<String> pathComponents,
|
||||
{GitVersionFinder? git, String? repoPath}) async {
|
||||
return _isTestChange(pathComponents) ||
|
||||
|
@ -10,13 +10,13 @@ import 'package:pub_semver/pub_semver.dart';
|
||||
import 'package:pubspec_parse/pubspec_parse.dart';
|
||||
|
||||
import 'common/core.dart';
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/package_command.dart';
|
||||
import 'common/repository_package.dart';
|
||||
|
||||
const String _outputDirectoryFlag = 'output-dir';
|
||||
|
||||
/// A command to create an application that builds all in a single application.
|
||||
class CreateAllPluginsAppCommand extends PluginCommand {
|
||||
class CreateAllPluginsAppCommand extends PackageCommand {
|
||||
/// Creates an instance of the builder command.
|
||||
CreateAllPluginsAppCommand(
|
||||
Directory packagesDir, {
|
||||
|
@ -49,7 +49,7 @@ class DriveExamplesCommand extends PackageLoopingCommand {
|
||||
final String name = 'drive-examples';
|
||||
|
||||
@override
|
||||
final String description = 'Runs driver tests for plugin example apps.\n\n'
|
||||
final String description = 'Runs driver tests for package example apps.\n\n'
|
||||
'For each *_test.dart in test_driver/ it drives an application with '
|
||||
'either the corresponding test in test_driver (for example, '
|
||||
'test_driver/app_test.dart would match test_driver/app.dart), or the '
|
||||
|
@ -11,7 +11,7 @@ import 'package:meta/meta.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
|
||||
import 'common/core.dart';
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/package_command.dart';
|
||||
import 'common/process_runner.dart';
|
||||
|
||||
/// In theory this should be 8191, but in practice that was still resulting in
|
||||
@ -37,7 +37,7 @@ final Uri _googleFormatterUrl = Uri.https('github.com',
|
||||
'/google/google-java-format/releases/download/google-java-format-1.3/google-java-format-1.3-all-deps.jar');
|
||||
|
||||
/// A command to format all package code.
|
||||
class FormatCommand extends PluginCommand {
|
||||
class FormatCommand extends PackageCommand {
|
||||
/// Creates an instance of the format command.
|
||||
FormatCommand(
|
||||
Directory packagesDir, {
|
||||
|
@ -8,7 +8,7 @@ import 'package:path/path.dart' as p;
|
||||
import 'package:platform/platform.dart';
|
||||
|
||||
import 'common/core.dart';
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/package_command.dart';
|
||||
|
||||
const Set<String> _codeFileExtensions = <String>{
|
||||
'.c',
|
||||
@ -105,7 +105,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
''';
|
||||
|
||||
/// Validates that code files have copyright and license blocks.
|
||||
class LicenseCheckCommand extends PluginCommand {
|
||||
class LicenseCheckCommand extends PackageCommand {
|
||||
/// Creates a new license check command for [packagesDir].
|
||||
LicenseCheckCommand(Directory packagesDir,
|
||||
{Platform platform = const LocalPlatform(), GitDir? gitDir})
|
||||
|
@ -5,11 +5,11 @@
|
||||
import 'package:file/file.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/package_command.dart';
|
||||
import 'common/repository_package.dart';
|
||||
|
||||
/// A command to list different types of repository content.
|
||||
class ListCommand extends PluginCommand {
|
||||
class ListCommand extends PackageCommand {
|
||||
/// Creates an instance of the list command, whose behavior depends on the
|
||||
/// 'type' argument it provides.
|
||||
ListCommand(
|
||||
@ -18,14 +18,14 @@ class ListCommand extends PluginCommand {
|
||||
}) : super(packagesDir, platform: platform) {
|
||||
argParser.addOption(
|
||||
_type,
|
||||
defaultsTo: _plugin,
|
||||
allowed: <String>[_plugin, _example, _package, _file],
|
||||
defaultsTo: _package,
|
||||
allowed: <String>[_package, _example, _allPackage, _file],
|
||||
help: 'What type of file system content to list.',
|
||||
);
|
||||
}
|
||||
|
||||
static const String _type = 'type';
|
||||
static const String _plugin = 'plugin';
|
||||
static const String _allPackage = 'package-or-subpackage';
|
||||
static const String _example = 'example';
|
||||
static const String _package = 'package';
|
||||
static const String _file = 'file';
|
||||
@ -39,7 +39,7 @@ class ListCommand extends PluginCommand {
|
||||
@override
|
||||
Future<void> run() async {
|
||||
switch (getStringArg(_type)) {
|
||||
case _plugin:
|
||||
case _package:
|
||||
await for (final PackageEnumerationEntry entry in getTargetPackages()) {
|
||||
print(entry.package.path);
|
||||
}
|
||||
@ -52,7 +52,7 @@ class ListCommand extends PluginCommand {
|
||||
print(package.path);
|
||||
}
|
||||
break;
|
||||
case _package:
|
||||
case _allPackage:
|
||||
await for (final PackageEnumerationEntry entry
|
||||
in getTargetPackagesAndSubpackages()) {
|
||||
print(entry.package.path);
|
||||
|
@ -25,7 +25,7 @@ import 'list_command.dart';
|
||||
import 'make_deps_path_based_command.dart';
|
||||
import 'native_test_command.dart';
|
||||
import 'publish_check_command.dart';
|
||||
import 'publish_plugin_command.dart';
|
||||
import 'publish_command.dart';
|
||||
import 'pubspec_check_command.dart';
|
||||
import 'readme_check_command.dart';
|
||||
import 'remove_dev_dependencies.dart';
|
||||
@ -69,7 +69,7 @@ void main(List<String> args) {
|
||||
..addCommand(NativeTestCommand(packagesDir))
|
||||
..addCommand(MakeDepsPathBasedCommand(packagesDir))
|
||||
..addCommand(PublishCheckCommand(packagesDir))
|
||||
..addCommand(PublishPluginCommand(packagesDir))
|
||||
..addCommand(PublishCommand(packagesDir))
|
||||
..addCommand(PubspecCheckCommand(packagesDir))
|
||||
..addCommand(ReadmeCheckCommand(packagesDir))
|
||||
..addCommand(RemoveDevDependenciesCommand(packagesDir))
|
||||
|
@ -9,7 +9,7 @@ import 'package:pub_semver/pub_semver.dart';
|
||||
|
||||
import 'common/core.dart';
|
||||
import 'common/git_version_finder.dart';
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/package_command.dart';
|
||||
import 'common/repository_package.dart';
|
||||
|
||||
const int _exitPackageNotFound = 3;
|
||||
@ -24,7 +24,7 @@ enum _RewriteOutcome { changed, noChangesNeeded, alreadyChanged }
|
||||
/// where a non-breaking change to a platform interface package of a federated
|
||||
/// plugin would cause post-publish analyzer failures in another package of that
|
||||
/// plugin.
|
||||
class MakeDepsPathBasedCommand extends PluginCommand {
|
||||
class MakeDepsPathBasedCommand extends PackageCommand {
|
||||
/// Creates an instance of the command to convert selected dependencies to
|
||||
/// path-based.
|
||||
MakeDepsPathBasedCommand(
|
||||
@ -150,7 +150,7 @@ class MakeDepsPathBasedCommand extends PluginCommand {
|
||||
return _RewriteOutcome.alreadyChanged;
|
||||
}
|
||||
printError(
|
||||
'Plugins with dependency overrides are not currently supported.');
|
||||
'Packages with dependency overrides are not currently supported.');
|
||||
throw ToolExit(_exitCannotUpdatePubspec);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ class PublishCheckCommand extends PackageLoopingCommand {
|
||||
|
||||
@override
|
||||
final String description =
|
||||
'Checks to make sure that a plugin *could* be published.';
|
||||
'Checks to make sure that a package *could* be published.';
|
||||
|
||||
final PubVersionFinder _pubVersionFinder;
|
||||
|
||||
|
@ -18,8 +18,8 @@ import 'package:yaml/yaml.dart';
|
||||
import 'common/core.dart';
|
||||
import 'common/file_utils.dart';
|
||||
import 'common/git_version_finder.dart';
|
||||
import 'common/package_command.dart';
|
||||
import 'common/package_looping_command.dart';
|
||||
import 'common/plugin_command.dart';
|
||||
import 'common/process_runner.dart';
|
||||
import 'common/pub_version_finder.dart';
|
||||
import 'common/repository_package.dart';
|
||||
@ -42,13 +42,13 @@ class _RemoteInfo {
|
||||
/// 2. Tags the release with the format <package-name>-v<package-version>.
|
||||
/// 3. Pushes the release to a remote.
|
||||
///
|
||||
/// Both 2 and 3 are optional, see `plugin_tools help publish-plugin` for full
|
||||
/// Both 2 and 3 are optional, see `plugin_tools help publish` for full
|
||||
/// usage information.
|
||||
///
|
||||
/// [processRunner], [print], and [stdin] can be overriden for easier testing.
|
||||
class PublishPluginCommand extends PackageLoopingCommand {
|
||||
class PublishCommand extends PackageLoopingCommand {
|
||||
/// Creates an instance of the publish command.
|
||||
PublishPluginCommand(
|
||||
PublishCommand(
|
||||
Directory packagesDir, {
|
||||
ProcessRunner processRunner = const ProcessRunner(),
|
||||
Platform platform = const LocalPlatform(),
|
||||
@ -100,7 +100,7 @@ class PublishPluginCommand extends PackageLoopingCommand {
|
||||
static const String _tagFormat = '%PACKAGE%-v%VERSION%';
|
||||
|
||||
@override
|
||||
final String name = 'publish-plugin';
|
||||
final String name = 'publish';
|
||||
|
||||
@override
|
||||
final String description =
|
@ -170,7 +170,7 @@ class VersionCheckCommand extends PackageLoopingCommand {
|
||||
|
||||
@override
|
||||
final String description =
|
||||
'Checks if the versions of the plugins have been incremented per pub specification.\n'
|
||||
'Checks if the versions of packages have been incremented per pub specification.\n'
|
||||
'Also checks if the latest version in CHANGELOG matches the version in pubspec.\n\n'
|
||||
'This command requires "pub" and "flutter" to be in your path.';
|
||||
|
||||
@ -318,7 +318,7 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body}
|
||||
print('${indentation}Unable to find previous version '
|
||||
'${getBoolArg(_againstPubFlag) ? 'on pub server' : 'at git base'}.');
|
||||
logWarning(
|
||||
'${indentation}If this plugin is not new, something has gone wrong.');
|
||||
'${indentation}If this package is not new, something has gone wrong.');
|
||||
return _CurrentVersionState.validIncrease; // Assume new, thus valid.
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: flutter_plugin_tools
|
||||
description: Productivity utils for flutter/plugins and flutter/packages
|
||||
repository: https://github.com/flutter/plugins/tree/main/script/tool
|
||||
version: 0.10.0+1
|
||||
version: 0.11.0
|
||||
|
||||
dependencies:
|
||||
args: ^2.1.0
|
||||
|
@ -37,7 +37,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('analyzes all packages', () async {
|
||||
final RepositoryPackage plugin1 = createFakePlugin('a', packagesDir);
|
||||
final RepositoryPackage package1 = createFakePackage('a', packagesDir);
|
||||
final RepositoryPackage plugin2 = createFakePlugin('b', packagesDir);
|
||||
|
||||
await runCapturingPrint(runner, <String>['analyze']);
|
||||
@ -45,9 +45,9 @@ void main() {
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
orderedEquals(<ProcessCall>[
|
||||
ProcessCall('flutter', const <String>['pub', 'get'], plugin1.path),
|
||||
ProcessCall(
|
||||
'dart', const <String>['analyze', '--fatal-infos'], plugin1.path),
|
||||
ProcessCall('flutter', const <String>['pub', 'get'], package1.path),
|
||||
ProcessCall('dart', const <String>['analyze', '--fatal-infos'],
|
||||
package1.path),
|
||||
ProcessCall('flutter', const <String>['pub', 'get'], plugin2.path),
|
||||
ProcessCall(
|
||||
'dart', const <String>['analyze', '--fatal-infos'], plugin2.path),
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_plugin_tools/src/common/git_version_finder.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'plugin_command_test.mocks.dart';
|
||||
import 'package_command_test.mocks.dart';
|
||||
|
||||
void main() {
|
||||
late List<List<String>?> gitDirCommands;
|
||||
|
@ -8,7 +8,7 @@ import 'package:args/command_runner.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/core.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/plugin_command.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/package_command.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/process_runner.dart';
|
||||
import 'package:git/git.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
@ -18,12 +18,12 @@ import 'package:test/test.dart';
|
||||
|
||||
import '../mocks.dart';
|
||||
import '../util.dart';
|
||||
import 'plugin_command_test.mocks.dart';
|
||||
import 'package_command_test.mocks.dart';
|
||||
|
||||
@GenerateMocks(<Type>[GitDir])
|
||||
void main() {
|
||||
late RecordingProcessRunner processRunner;
|
||||
late SamplePluginCommand command;
|
||||
late SamplePackageCommand command;
|
||||
late CommandRunner<void> runner;
|
||||
late FileSystem fileSystem;
|
||||
late MockPlatform mockPlatform;
|
||||
@ -49,7 +49,7 @@ void main() {
|
||||
return processRunner.run('git-$gitCommand', arguments);
|
||||
});
|
||||
processRunner = RecordingProcessRunner();
|
||||
command = SamplePluginCommand(
|
||||
command = SamplePackageCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
platform: mockPlatform,
|
||||
@ -282,7 +282,7 @@ packages/plugin1/plugin1/plugin1.dart
|
||||
});
|
||||
|
||||
test('returns subpackages after the enclosing package', () async {
|
||||
final SamplePluginCommand localCommand = SamplePluginCommand(
|
||||
final SamplePackageCommand localCommand = SamplePackageCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
platform: mockPlatform,
|
||||
@ -848,7 +848,7 @@ packages/b_package/lib/src/foo.dart
|
||||
];
|
||||
|
||||
for (int i = 0; i < expectedShards.length; ++i) {
|
||||
final SamplePluginCommand localCommand = SamplePluginCommand(
|
||||
final SamplePackageCommand localCommand = SamplePackageCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
platform: mockPlatform,
|
||||
@ -892,7 +892,7 @@ packages/b_package/lib/src/foo.dart
|
||||
];
|
||||
|
||||
for (int i = 0; i < expectedShards.length; ++i) {
|
||||
final SamplePluginCommand localCommand = SamplePluginCommand(
|
||||
final SamplePackageCommand localCommand = SamplePackageCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
platform: mockPlatform,
|
||||
@ -945,7 +945,7 @@ packages/b_package/lib/src/foo.dart
|
||||
createFakePackage('package9', packagesDir);
|
||||
|
||||
for (int i = 0; i < expectedShards.length; ++i) {
|
||||
final SamplePluginCommand localCommand = SamplePluginCommand(
|
||||
final SamplePackageCommand localCommand = SamplePackageCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
platform: mockPlatform,
|
||||
@ -971,8 +971,8 @@ packages/b_package/lib/src/foo.dart
|
||||
});
|
||||
}
|
||||
|
||||
class SamplePluginCommand extends PluginCommand {
|
||||
SamplePluginCommand(
|
||||
class SamplePackageCommand extends PackageCommand {
|
||||
SamplePackageCommand(
|
||||
Directory packagesDir, {
|
||||
ProcessRunner processRunner = const ProcessRunner(),
|
||||
Platform platform = const LocalPlatform(),
|
@ -18,7 +18,7 @@ import 'package:test/test.dart';
|
||||
|
||||
import '../mocks.dart';
|
||||
import '../util.dart';
|
||||
import 'plugin_command_test.mocks.dart';
|
||||
import 'package_command_test.mocks.dart';
|
||||
|
||||
// Constants for colorized output start and end.
|
||||
const String _startElapsedTimeColor = '\x1B[90m';
|
||||
@ -373,9 +373,10 @@ void main() {
|
||||
|
||||
test('skips unsupported Dart versions when requested', () async {
|
||||
final RepositoryPackage excluded = createFakePackage(
|
||||
'excluded_package', packagesDir, dartConstraint: '>=2.17.0 <3.0.0');
|
||||
final RepositoryPackage included = createFakePackage(
|
||||
'a_package', packagesDir);
|
||||
'excluded_package', packagesDir,
|
||||
dartConstraint: '>=2.17.0 <3.0.0');
|
||||
final RepositoryPackage included =
|
||||
createFakePackage('a_package', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command = createTestCommand(
|
||||
packageLoopingType: PackageLoopingType.includeAllSubpackages,
|
||||
@ -406,8 +407,7 @@ void main() {
|
||||
createFakePlugin('package_a', packagesDir);
|
||||
createFakePackage('package_b', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command =
|
||||
createTestCommand();
|
||||
final TestPackageLoopingCommand command = createTestCommand();
|
||||
final List<String> output = await runCommand(command);
|
||||
|
||||
const String separator =
|
||||
@ -440,8 +440,7 @@ void main() {
|
||||
createFakePlugin('package_a', packagesDir);
|
||||
createFakePackage('package_b', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command =
|
||||
createTestCommand();
|
||||
final TestPackageLoopingCommand command = createTestCommand();
|
||||
final List<String> output =
|
||||
await runCommand(command, arguments: <String>['--log-timing']);
|
||||
|
||||
@ -783,8 +782,7 @@ void main() {
|
||||
|
||||
createFakePackage('package_f', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command =
|
||||
createTestCommand();
|
||||
final TestPackageLoopingCommand command = createTestCommand();
|
||||
final List<String> output = await runCommand(command);
|
||||
|
||||
expect(
|
||||
@ -809,8 +807,7 @@ void main() {
|
||||
test('prints exclusions as skips in long-form run summary', () async {
|
||||
createFakePackage('package_a', packagesDir);
|
||||
|
||||
final TestPackageLoopingCommand command =
|
||||
createTestCommand();
|
||||
final TestPackageLoopingCommand command = createTestCommand();
|
||||
final List<String> output =
|
||||
await runCommand(command, arguments: <String>['--exclude=package_a']);
|
||||
|
||||
|
@ -40,7 +40,7 @@ void main() {
|
||||
|
||||
test('runs both new and legacy when both are present', () async {
|
||||
final RepositoryPackage package =
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
@ -65,7 +65,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('runs when only new is present', () async {
|
||||
final RepositoryPackage package = createFakePlugin(
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package', packagesDir,
|
||||
extraFiles: <String>['tool/run_tests.dart']);
|
||||
|
||||
@ -87,7 +87,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('runs pub get before running Dart test script', () async {
|
||||
final RepositoryPackage package = createFakePlugin(
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package', packagesDir,
|
||||
extraFiles: <String>['tool/run_tests.dart']);
|
||||
|
||||
@ -103,7 +103,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('runs when only legacy is present', () async {
|
||||
final RepositoryPackage package = createFakePlugin(
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package', packagesDir,
|
||||
extraFiles: <String>['run_tests.sh']);
|
||||
|
||||
@ -125,7 +125,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('skips when neither is present', () async {
|
||||
createFakePlugin('a_package', packagesDir);
|
||||
createFakePackage('a_package', packagesDir);
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(runner, <String>['custom-test']);
|
||||
@ -140,7 +140,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('fails if new fails', () async {
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
@ -166,7 +166,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('fails if pub get fails', () async {
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
@ -193,7 +193,7 @@ void main() {
|
||||
|
||||
test('fails if legacy fails', () async {
|
||||
final RepositoryPackage package =
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
@ -238,7 +238,7 @@ void main() {
|
||||
|
||||
test('runs new and skips old when both are present', () async {
|
||||
final RepositoryPackage package =
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
@ -261,7 +261,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('runs when only new is present', () async {
|
||||
final RepositoryPackage package = createFakePlugin(
|
||||
final RepositoryPackage package = createFakePackage(
|
||||
'a_package', packagesDir,
|
||||
extraFiles: <String>['tool/run_tests.dart']);
|
||||
|
||||
@ -283,7 +283,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('skips package when only legacy is present', () async {
|
||||
createFakePlugin('a_package', packagesDir,
|
||||
createFakePackage('a_package', packagesDir,
|
||||
extraFiles: <String>['run_tests.sh']);
|
||||
|
||||
final List<String> output =
|
||||
@ -300,7 +300,7 @@ void main() {
|
||||
});
|
||||
|
||||
test('fails if new fails', () async {
|
||||
createFakePlugin('a_package', packagesDir, extraFiles: <String>[
|
||||
createFakePackage('a_package', packagesDir, extraFiles: <String>[
|
||||
'tool/run_tests.dart',
|
||||
'run_tests.sh',
|
||||
]);
|
||||
|
@ -10,7 +10,7 @@ import 'package:flutter_plugin_tools/src/dependabot_check_command.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
void main() {
|
||||
|
@ -12,7 +12,7 @@ import 'package:flutter_plugin_tools/src/federation_safety_check_command.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -60,15 +60,15 @@ void main() {
|
||||
}
|
||||
|
||||
/// Returns a list of [count] relative paths to pass to [createFakePlugin]
|
||||
/// with name [pluginName] such that each path will be 99 characters long
|
||||
/// relative to [packagesDir].
|
||||
/// or [createFakePackage] with name [packageName] such that each path will
|
||||
/// be 99 characters long relative to [packagesDir].
|
||||
///
|
||||
/// This is for each of testing batching, since it means each file will
|
||||
/// consume 100 characters of the batch length.
|
||||
List<String> _get99CharacterPathExtraFiles(String pluginName, int count) {
|
||||
List<String> _get99CharacterPathExtraFiles(String packageName, int count) {
|
||||
final int padding = 99 -
|
||||
pluginName.length -
|
||||
1 - // the path separator after the plugin name
|
||||
packageName.length -
|
||||
1 - // the path separator after the package name
|
||||
1 - // the path separator after the padding
|
||||
10; // the file name
|
||||
const int filenameBase = 10000;
|
||||
|
@ -11,7 +11,7 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -29,17 +29,17 @@ void main() {
|
||||
runner.addCommand(command);
|
||||
});
|
||||
|
||||
test('lists plugins', () async {
|
||||
createFakePlugin('plugin1', packagesDir);
|
||||
test('lists top-level packages', () async {
|
||||
createFakePackage('package1', packagesDir);
|
||||
createFakePlugin('plugin2', packagesDir);
|
||||
|
||||
final List<String> plugins =
|
||||
await runCapturingPrint(runner, <String>['list', '--type=plugin']);
|
||||
await runCapturingPrint(runner, <String>['list', '--type=package']);
|
||||
|
||||
expect(
|
||||
plugins,
|
||||
orderedEquals(<String>[
|
||||
'/packages/plugin1',
|
||||
'/packages/package1',
|
||||
'/packages/plugin2',
|
||||
]),
|
||||
);
|
||||
@ -64,20 +64,20 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
test('lists packages', () async {
|
||||
createFakePlugin('plugin1', packagesDir);
|
||||
test('lists packages and subpackages', () async {
|
||||
createFakePackage('package1', packagesDir);
|
||||
createFakePlugin('plugin2', packagesDir,
|
||||
examples: <String>['example1', 'example2']);
|
||||
createFakePlugin('plugin3', packagesDir, examples: <String>[]);
|
||||
|
||||
final List<String> packages =
|
||||
await runCapturingPrint(runner, <String>['list', '--type=package']);
|
||||
final List<String> packages = await runCapturingPrint(
|
||||
runner, <String>['list', '--type=package-or-subpackage']);
|
||||
|
||||
expect(
|
||||
packages,
|
||||
unorderedEquals(<String>[
|
||||
'/packages/plugin1',
|
||||
'/packages/plugin1/example',
|
||||
'/packages/package1',
|
||||
'/packages/package1/example',
|
||||
'/packages/plugin2',
|
||||
'/packages/plugin2/example/example1',
|
||||
'/packages/plugin2/example/example2',
|
||||
|
@ -11,7 +11,7 @@ import 'package:flutter_plugin_tools/src/make_deps_path_based_command.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -10,14 +10,14 @@ import 'package:args/command_runner.dart';
|
||||
import 'package:file/file.dart';
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_plugin_tools/src/common/core.dart';
|
||||
import 'package:flutter_plugin_tools/src/publish_plugin_command.dart';
|
||||
import 'package:flutter_plugin_tools/src/publish_command.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:http/testing.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:platform/platform.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
@ -34,7 +34,7 @@ void main() {
|
||||
late Map<String, Map<String, dynamic>> mockHttpResponses;
|
||||
|
||||
void _createMockCredentialFile() {
|
||||
final String credentialPath = PublishPluginCommand.getCredentialPath();
|
||||
final String credentialPath = PublishCommand.getCredentialPath();
|
||||
fileSystem.file(credentialPath)
|
||||
..createSync(recursive: true)
|
||||
..writeAsStringSync('some credential');
|
||||
@ -72,7 +72,7 @@ void main() {
|
||||
|
||||
mockStdin = MockStdin();
|
||||
commandRunner = CommandRunner<void>('tester', '')
|
||||
..addCommand(PublishPluginCommand(
|
||||
..addCommand(PublishCommand(
|
||||
packagesDir,
|
||||
processRunner: processRunner,
|
||||
stdinput: mockStdin,
|
||||
@ -93,7 +93,7 @@ void main() {
|
||||
Error? commandError;
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
], errorHandler: (Error e) {
|
||||
commandError = e;
|
||||
@ -122,7 +122,7 @@ void main() {
|
||||
|
||||
Error? commandError;
|
||||
final List<String> output = await runCapturingPrint(
|
||||
commandRunner, <String>['publish-plugin', '--packages=foo'],
|
||||
commandRunner, <String>['publish', '--packages=foo'],
|
||||
errorHandler: (Error e) {
|
||||
commandError = e;
|
||||
});
|
||||
@ -154,8 +154,8 @@ void main() {
|
||||
stderrEncoding: utf8), // pub publish for plugin1
|
||||
];
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--packages=plugin1,plugin2']);
|
||||
final List<String> output = await runCapturingPrint(
|
||||
commandRunner, <String>['publish', '--packages=plugin1,plugin2']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
@ -176,7 +176,7 @@ void main() {
|
||||
mockStdin.mockUserInputs.add(utf8.encode('user input'));
|
||||
|
||||
await runCapturingPrint(
|
||||
commandRunner, <String>['publish-plugin', '--packages=foo']);
|
||||
commandRunner, <String>['publish', '--packages=foo']);
|
||||
|
||||
expect(processRunner.mockPublishProcess.stdinMock.lines,
|
||||
contains('user input'));
|
||||
@ -187,7 +187,7 @@ void main() {
|
||||
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
||||
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
'--pub-publish-flags',
|
||||
'--dry-run,--server=bar'
|
||||
@ -209,7 +209,7 @@ void main() {
|
||||
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
||||
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
'--skip-confirmation',
|
||||
'--pub-publish-flags',
|
||||
@ -232,7 +232,7 @@ void main() {
|
||||
createFakePlugin('plugin_b', packagesDir, examples: <String>[]);
|
||||
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=plugin_a,plugin_b',
|
||||
'--skip-confirmation',
|
||||
'--pub-publish-flags',
|
||||
@ -263,7 +263,7 @@ void main() {
|
||||
Error? commandError;
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
], errorHandler: (Error e) {
|
||||
commandError = e;
|
||||
@ -283,7 +283,7 @@ void main() {
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
'--dry-run',
|
||||
]);
|
||||
@ -310,7 +310,7 @@ void main() {
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=$packageName',
|
||||
]);
|
||||
|
||||
@ -330,7 +330,7 @@ void main() {
|
||||
test('with the version and name from the pubspec.yaml', () async {
|
||||
createFakePlugin('foo', packagesDir, examples: <String>[]);
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
]);
|
||||
|
||||
@ -348,7 +348,7 @@ void main() {
|
||||
Error? commandError;
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
], errorHandler: (Error e) {
|
||||
commandError = e;
|
||||
@ -375,7 +375,7 @@ void main() {
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
]);
|
||||
|
||||
@ -398,7 +398,7 @@ void main() {
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--skip-confirmation',
|
||||
'--packages=foo',
|
||||
]);
|
||||
@ -420,8 +420,8 @@ void main() {
|
||||
|
||||
mockStdin.readLineOutput = 'y';
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--packages=foo', '--dry-run']);
|
||||
final List<String> output = await runCapturingPrint(
|
||||
commandRunner, <String>['publish', '--packages=foo', '--dry-run']);
|
||||
|
||||
expect(
|
||||
processRunner.recordedCalls
|
||||
@ -445,7 +445,7 @@ void main() {
|
||||
|
||||
final List<String> output =
|
||||
await runCapturingPrint(commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--packages=foo',
|
||||
'--remote',
|
||||
'origin',
|
||||
@ -491,7 +491,7 @@ void main() {
|
||||
mockStdin.readLineOutput = 'y';
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
@ -553,7 +553,7 @@ void main() {
|
||||
mockStdin.readLineOutput = 'y';
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
@ -598,7 +598,7 @@ void main() {
|
||||
|
||||
final List<String> output = await runCapturingPrint(
|
||||
commandRunner, <String>[
|
||||
'publish-plugin',
|
||||
'publish',
|
||||
'--all-changed',
|
||||
'--base-sha=HEAD~',
|
||||
'--dry-run'
|
||||
@ -651,7 +651,7 @@ void main() {
|
||||
mockStdin.readLineOutput = 'y';
|
||||
|
||||
final List<String> output2 = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
expect(
|
||||
output2,
|
||||
containsAllInOrder(<Matcher>[
|
||||
@ -700,7 +700,7 @@ void main() {
|
||||
mockStdin.readLineOutput = 'y';
|
||||
|
||||
final List<String> output2 = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
expect(
|
||||
output2,
|
||||
containsAllInOrder(<Matcher>[
|
||||
@ -749,7 +749,7 @@ void main() {
|
||||
];
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
|
||||
expect(
|
||||
output,
|
||||
@ -795,7 +795,7 @@ void main() {
|
||||
|
||||
Error? commandError;
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~'],
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~'],
|
||||
errorHandler: (Error e) {
|
||||
commandError = e;
|
||||
});
|
||||
@ -830,7 +830,7 @@ void main() {
|
||||
];
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
|
||||
expect(output, containsAllInOrder(<String>['Ran for 0 package(s)']));
|
||||
expect(
|
||||
@ -852,7 +852,7 @@ void main() {
|
||||
];
|
||||
|
||||
final List<String> output = await runCapturingPrint(commandRunner,
|
||||
<String>['publish-plugin', '--all-changed', '--base-sha=HEAD~']);
|
||||
<String>['publish', '--all-changed', '--base-sha=HEAD~']);
|
||||
|
||||
expect(
|
||||
output,
|
@ -12,7 +12,7 @@ import 'package:flutter_plugin_tools/src/update_excerpts_command.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -12,7 +12,7 @@ import 'package:flutter_plugin_tools/src/update_release_info_command.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -16,7 +16,7 @@ import 'package:mockito/mockito.dart';
|
||||
import 'package:pub_semver/pub_semver.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
import 'common/plugin_command_test.mocks.dart';
|
||||
import 'common/package_command_test.mocks.dart';
|
||||
import 'mocks.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
Reference in New Issue
Block a user