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