Show output from pub get in flutter pub get (#106300)
This commit is contained in:
@@ -14,6 +14,7 @@ import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/convert.dart';
|
||||
import 'package:flutter_tools/src/features.dart';
|
||||
import 'package:flutter_tools/src/ios/plist_parser.dart';
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
import 'package:flutter_tools/src/version.dart';
|
||||
import 'package:test/fake.dart';
|
||||
|
||||
@@ -561,3 +562,13 @@ class FakeStopwatchFactory implements StopwatchFactory {
|
||||
return stopwatches[name] ?? FakeStopwatch();
|
||||
}
|
||||
}
|
||||
|
||||
class FakeFlutterProjectFactory implements FlutterProjectFactory {
|
||||
@override
|
||||
FlutterProject fromDirectory(Directory directory) {
|
||||
return FlutterProject.fromDirectoryTest(directory);
|
||||
}
|
||||
|
||||
@override
|
||||
Map<String, FlutterProject> get projects => throw UnimplementedError();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ Future<String> createProject(Directory temp, { List<String>? arguments }) async
|
||||
final CreateCommand command = CreateCommand();
|
||||
final CommandRunner<void> runner = createTestCommandRunner(command);
|
||||
await runner.run(<String>['create', ...arguments, projectPath]);
|
||||
// Created `.packages` since it's not created when the flag `--no-pub` is passed.
|
||||
// Create `.packages` since it's not created when the flag `--no-pub` is passed.
|
||||
globals.fs.file(globals.fs.path.join(projectPath, '.packages')).createSync();
|
||||
return projectPath;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
import 'package:flutter_tools/src/dart/pub.dart';
|
||||
import 'package:flutter_tools/src/project.dart';
|
||||
|
||||
class ThrowingPub implements Pub {
|
||||
@override
|
||||
@@ -12,8 +13,6 @@ class ThrowingPub implements Pub {
|
||||
String? directory,
|
||||
MessageFilter? filter,
|
||||
String? failureMessage = 'pub failed',
|
||||
bool? retry,
|
||||
bool? showTraceForErrors,
|
||||
}) {
|
||||
throw UnsupportedError('Attempted to invoke pub during test.');
|
||||
}
|
||||
@@ -21,13 +20,14 @@ class ThrowingPub implements Pub {
|
||||
@override
|
||||
Future<void> get({
|
||||
PubContext? context,
|
||||
String? directory,
|
||||
required FlutterProject project,
|
||||
bool skipIfAbsent = false,
|
||||
bool upgrade = false,
|
||||
bool offline = false,
|
||||
bool checkLastModified = true,
|
||||
bool skipPubspecYamlCheck = false,
|
||||
bool generateSyntheticPackage = false,
|
||||
bool generateSyntheticPackageForExample = false,
|
||||
String? flutterRootOverride,
|
||||
bool checkUpToDate = false,
|
||||
bool shouldSkipThirdPartyGenerator = true,
|
||||
|
||||
Reference in New Issue
Block a user