mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 17:28:42 +08:00
[tool] Use 'flutter pub get' for Flutter packages (#4397)
Extracts common logic for running `pub get`, and switches commands to use it. The common logic always uses `flutter pub get` for Flutter packages, rather than `dart pub get`, since the latter will fail if someone has a non-Flutter `dart` in their path before `flutter` (e.g., Dart team members contributing PRs).
This commit is contained in:
@ -48,7 +48,7 @@ void main() {
|
||||
expect(
|
||||
processRunner.recordedCalls,
|
||||
containsAll(<ProcessCall>[
|
||||
ProcessCall('dart', const <String>['pub', 'get'], example.path),
|
||||
ProcessCall('flutter', const <String>['pub', 'get'], example.path),
|
||||
ProcessCall(
|
||||
'dart',
|
||||
const <String>[
|
||||
@ -218,7 +218,7 @@ void main() {
|
||||
final RepositoryPackage package = createFakePlugin('a_package', packagesDir,
|
||||
extraFiles: <String>[kReadmeExcerptConfigPath]);
|
||||
|
||||
processRunner.mockProcessesForExecutable['dart'] = <FakeProcessInfo>[
|
||||
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
|
||||
FakeProcessInfo(MockProcess(exitCode: 1), <String>['pub', 'get'])
|
||||
];
|
||||
|
||||
@ -249,7 +249,7 @@ void main() {
|
||||
createFakePlugin('a_package', packagesDir,
|
||||
extraFiles: <String>[kReadmeExcerptConfigPath]);
|
||||
|
||||
processRunner.mockProcessesForExecutable['dart'] = <FakeProcessInfo>[
|
||||
processRunner.mockProcessesForExecutable['flutter'] = <FakeProcessInfo>[
|
||||
FakeProcessInfo(MockProcess(exitCode: 1), <String>['pub', 'get'])
|
||||
];
|
||||
|
||||
@ -274,7 +274,6 @@ void main() {
|
||||
extraFiles: <String>[kReadmeExcerptConfigPath]);
|
||||
|
||||
processRunner.mockProcessesForExecutable['dart'] = <FakeProcessInfo>[
|
||||
FakeProcessInfo(MockProcess(), <String>['pub', 'get']),
|
||||
FakeProcessInfo(MockProcess(exitCode: 1), <String>['run', 'build_runner'])
|
||||
];
|
||||
|
||||
@ -299,7 +298,6 @@ void main() {
|
||||
extraFiles: <String>[kReadmeExcerptConfigPath]);
|
||||
|
||||
processRunner.mockProcessesForExecutable['dart'] = <FakeProcessInfo>[
|
||||
FakeProcessInfo(MockProcess(), <String>['pub', 'get']),
|
||||
FakeProcessInfo(MockProcess(), <String>['run', 'build_runner']),
|
||||
FakeProcessInfo(
|
||||
MockProcess(exitCode: 1), <String>['run', 'code_excerpt_updater']),
|
||||
@ -326,7 +324,6 @@ void main() {
|
||||
extraFiles: <String>[kReadmeExcerptConfigPath, 'example/README.md']);
|
||||
|
||||
processRunner.mockProcessesForExecutable['dart'] = <FakeProcessInfo>[
|
||||
FakeProcessInfo(MockProcess(), <String>['pub', 'get']),
|
||||
FakeProcessInfo(MockProcess(), <String>['run', 'build_runner']),
|
||||
FakeProcessInfo(MockProcess(), <String>['run', 'code_excerpt_updater']),
|
||||
FakeProcessInfo(
|
||||
|
Reference in New Issue
Block a user