Skip to content

Commit 7fdb1b3

Browse files
stuartmorgan-gmauricioluz
authored andcommitted
[tool] Rename all-plugins-app command (flutter#6600)
1 parent 8ac192e commit 7fdb1b3

File tree

8 files changed

+122
-82
lines changed

8 files changed

+122
-82
lines changed

.ci/scripts/build_all_plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
cd all_plugins
6+
cd all_packages
77
flutter build windows --debug
88
flutter build windows --release

.ci/scripts/create_all_plugins_app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Use of this source code is governed by a BSD-style license that can be
44
# found in the LICENSE file.
55

6-
dart ./script/tool/bin/flutter_plugin_tools.dart all-plugins-app \
6+
dart ./script/tool/bin/flutter_plugin_tools.dart create-all-packages-app \
77
--output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml

.cirrus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ flutter_upgrade_template: &FLUTTER_UPGRADE_TEMPLATE
5252

5353
build_all_plugins_app_template: &BUILD_ALL_PLUGINS_APP_TEMPLATE
5454
create_all_plugins_app_script:
55-
- $PLUGIN_TOOL_COMMAND all-plugins-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
55+
- $PLUGIN_TOOL_COMMAND create-all-packages-app --output-dir=. --exclude script/configs/exclude_all_plugins_app.yaml
5656
build_all_plugins_debug_script:
57-
- cd all_plugins
57+
- cd all_packages
5858
- if [[ "$BUILD_ALL_ARGS" == "web" ]]; then
5959
- echo "Skipping; web does not support debug builds"
6060
- else
6161
- flutter build $BUILD_ALL_ARGS --debug
6262
- fi
6363
build_all_plugins_release_script:
64-
- cd all_plugins
64+
- cd all_packages
6565
- flutter build $BUILD_ALL_ARGS --release
6666

6767
# Light-workload Linux tasks.

script/tool/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 0.13.0
2+
3+
* Renames `all-plugins-app` to `create-all-packages-app` to clarify what it
4+
actually does. Also renames the project directory it creates from
5+
`all_plugins` to `all_packages`.
6+
17
## 0.12.1
28

39
* Modifies `publish_check_command.dart` to do a `dart pub get` in all examples

script/tool/lib/src/create_all_plugins_app_command.dart renamed to script/tool/lib/src/create_all_packages_app_command.dart

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ import 'common/repository_package.dart';
1717

1818
const String _outputDirectoryFlag = 'output-dir';
1919

20+
const String _projectName = 'all_packages';
21+
2022
const int _exitUpdateMacosPodfileFailed = 3;
2123
const int _exitUpdateMacosPbxprojFailed = 4;
2224
const int _exitGenNativeBuildFilesFailed = 5;
2325

2426
/// A command to create an application that builds all in a single application.
25-
class CreateAllPluginsAppCommand extends PackageCommand {
27+
class CreateAllPackagesAppCommand extends PackageCommand {
2628
/// Creates an instance of the builder command.
27-
CreateAllPluginsAppCommand(
29+
CreateAllPackagesAppCommand(
2830
Directory packagesDir, {
2931
ProcessRunner processRunner = const ProcessRunner(),
3032
Directory? pluginsRoot,
@@ -34,24 +36,25 @@ class CreateAllPluginsAppCommand extends PackageCommand {
3436
pluginsRoot ?? packagesDir.fileSystem.currentDirectory;
3537
argParser.addOption(_outputDirectoryFlag,
3638
defaultsTo: defaultDir.path,
37-
help: 'The path the directory to create the "all_plugins" project in.\n'
39+
help:
40+
'The path the directory to create the "$_projectName" project in.\n'
3841
'Defaults to the repository root.');
3942
}
4043

4144
/// The location to create the synthesized app project.
4245
Directory get _appDirectory => packagesDir.fileSystem
4346
.directory(getStringArg(_outputDirectoryFlag))
44-
.childDirectory('all_plugins');
47+
.childDirectory(_projectName);
4548

4649
/// The synthesized app project.
4750
RepositoryPackage get app => RepositoryPackage(_appDirectory);
4851

4952
@override
5053
String get description =>
51-
'Generate Flutter app that includes all plugins in packages.';
54+
'Generate Flutter app that includes all target packagas.';
5255

5356
@override
54-
String get name => 'all-plugins-app';
57+
String get name => 'create-all-packages-app';
5558

5659
@override
5760
Future<void> run() async {
@@ -100,7 +103,7 @@ class CreateAllPluginsAppCommand extends PackageCommand {
100103
<String>[
101104
'create',
102105
'--template=app',
103-
'--project-name=all_plugins',
106+
'--project-name=$_projectName',
104107
'--android-language=java',
105108
_appDirectory.path,
106109
],
@@ -160,9 +163,9 @@ class CreateAllPluginsAppCommand extends PackageCommand {
160163

161164
final StringBuffer newManifest = StringBuffer();
162165
for (final String line in manifestFile.readAsLinesSync()) {
163-
if (line.contains('package="com.example.all_plugins"')) {
166+
if (line.contains('package="com.example.$_projectName"')) {
164167
newManifest
165-
..writeln('package="com.example.all_plugins"')
168+
..writeln('package="com.example.$_projectName"')
166169
..writeln('xmlns:tools="http://schemas.android.com/tools">')
167170
..writeln()
168171
..writeln(
@@ -191,7 +194,7 @@ class CreateAllPluginsAppCommand extends PackageCommand {
191194
final Map<String, PathDependency> pluginDeps =
192195
await _getValidPathDependencies();
193196
final Pubspec pubspec = Pubspec(
194-
'all_plugins',
197+
_projectName,
195198
description: 'Flutter app containing all 1st party plugins.',
196199
version: Version.parse('1.0.0+1'),
197200
environment: <String, VersionConstraint>{

script/tool/lib/src/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import 'package:file/local.dart';
1111
import 'analyze_command.dart';
1212
import 'build_examples_command.dart';
1313
import 'common/core.dart';
14-
import 'create_all_plugins_app_command.dart';
14+
import 'create_all_packages_app_command.dart';
1515
import 'custom_test_command.dart';
1616
import 'dependabot_check_command.dart';
1717
import 'drive_examples_command.dart';
@@ -56,7 +56,7 @@ void main(List<String> args) {
5656
'Productivity utils for hosting multiple plugins within one repository.')
5757
..addCommand(AnalyzeCommand(packagesDir))
5858
..addCommand(BuildExamplesCommand(packagesDir))
59-
..addCommand(CreateAllPluginsAppCommand(packagesDir))
59+
..addCommand(CreateAllPackagesAppCommand(packagesDir))
6060
..addCommand(CustomTestCommand(packagesDir))
6161
..addCommand(DependabotCheckCommand(packagesDir))
6262
..addCommand(DriveExamplesCommand(packagesDir))

script/tool/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: flutter_plugin_tools
22
description: Productivity utils for flutter/plugins and flutter/packages
33
repository: https://github.com/flutter/plugins/tree/main/script/tool
4-
version: 0.12.1
4+
version: 0.13.0
55

66
dependencies:
77
args: ^2.1.0

0 commit comments

Comments
 (0)