Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into tool-all-plugin-rename
  • Loading branch information
stuartmorgan-g committed Oct 31, 2022
commit e4e2e70750abce2170a075b473df8b83185392f3
4 changes: 4 additions & 0 deletions script/tool/lib/src/create_all_packages_app_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const String _outputDirectoryFlag = 'output-dir';

const String _projectName = 'all_packages';

const int _exitUpdateMacosPodfileFailed = 3;
const int _exitUpdateMacosPbxprojFailed = 4;
const int _exitGenNativeBuildFilesFailed = 5;

/// A command to create an application that builds all in a single application.
class CreateAllPackagesAppCommand extends PackageCommand {
/// Creates an instance of the builder command.
Expand Down
17 changes: 9 additions & 8 deletions script/tool/test/create_all_packages_app_command_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'dart:io' as io;
import 'package:args/command_runner.dart';
import 'package:file/file.dart';
import 'package:file/local.dart';
import 'package:flutter_plugin_tools/src/common/core.dart';
import 'package:flutter_plugin_tools/src/create_all_packages_app_command.dart';
import 'package:platform/platform.dart';
import 'package:test/test.dart';
Expand Down Expand Up @@ -111,7 +112,7 @@ void main() {
createFakePlugin('plugina', packagesDir);

final File podfileFile = command.packagesDir.parent
.childDirectory('all_plugins')
.childDirectory('all_packages')
.childDirectory('macos')
.childFile('Podfile');
podfileFile.createSync(recursive: true);
Expand All @@ -120,7 +121,7 @@ platform :osx, '10.11'
# some other line
""");

await runCapturingPrint(runner, <String>['all-plugins-app']);
await runCapturingPrint(runner, <String>['create-all-packages-app']);
final List<String> podfile = command.app
.platformDirectory(FlutterPlatform.macos)
.childFile('Podfile')
Expand All @@ -137,7 +138,7 @@ platform :osx, '10.11'
test('macOS deployment target is modified in pbxproj', () async {
createFakePlugin('plugina', packagesDir);

await runCapturingPrint(runner, <String>['all-plugins-app']);
await runCapturingPrint(runner, <String>['create-all-packages-app']);
final List<String> pbxproj = command.app
.platformDirectory(FlutterPlatform.macos)
.childDirectory('Runner.xcodeproj')
Expand All @@ -154,18 +155,18 @@ platform :osx, '10.11'
test('calls flutter pub get', () async {
createFakePlugin('plugina', packagesDir);

await runCapturingPrint(runner, <String>['all-plugins-app']);
await runCapturingPrint(runner, <String>['create-all-packages-app']);

expect(
processRunner.recordedCalls,
orderedEquals(<ProcessCall>[
ProcessCall(
getFlutterCommand(const LocalPlatform()),
const <String>['pub', 'get'],
testRoot.childDirectory('all_plugins').path),
testRoot.childDirectory('all_packages').path),
]));
},
// See comment about Windows in create_all_plugins_app_command.dart
// See comment about Windows in create_all_packages_app_command.dart
skip: io.Platform.isWindows);

test('fails if flutter pub get fails', () async {
Expand All @@ -177,7 +178,7 @@ platform :osx, '10.11'
];
Error? commandError;
final List<String> output = await runCapturingPrint(
runner, <String>['all-plugins-app'], errorHandler: (Error e) {
runner, <String>['create-all-packages-app'], errorHandler: (Error e) {
commandError = e;
});

Expand All @@ -189,7 +190,7 @@ platform :osx, '10.11'
"Failed to generate native build files via 'flutter pub get'"),
]));
},
// See comment about Windows in create_all_plugins_app_command.dart
// See comment about Windows in create_all_packages_app_command.dart
skip: io.Platform.isWindows);

test('handles --output-dir', () async {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.