mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 17:28:42 +08:00
[tool] Update to Dart 3 (#6030)
Updates the repo tooling to Dart 3, now that the N-2 version has Dart 3, which allows us to use Dart 3 features (e.g., records) going forward. To allow the update: - Removes `break` commands from `switch`es (all done automatically with `dart fix --apply`) - Replaces mocking of `ProcessResult` with just creating an actual `ProcessResult` since it's a `final` data class and thus can't (but also doesn't need to be) mocked.
This commit is contained in:
@ -1,23 +1,26 @@
|
||||
// Mocks generated by Mockito 5.4.0 from annotations
|
||||
// Mocks generated by Mockito 5.4.4 from annotations
|
||||
// in flutter_plugin_tools/test/common/package_command_test.dart.
|
||||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:io' as _i4;
|
||||
import 'dart:io' as _i10;
|
||||
|
||||
import 'package:git/src/branch_reference.dart' as _i3;
|
||||
import 'package:git/src/commit.dart' as _i2;
|
||||
import 'package:git/src/commit_reference.dart' as _i8;
|
||||
import 'package:git/src/git_dir.dart' as _i5;
|
||||
import 'package:git/src/git_dir.dart' as _i4;
|
||||
import 'package:git/src/tag.dart' as _i7;
|
||||
import 'package:git/src/tree_entry.dart' as _i9;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:mockito/src/dummies.dart' as _i5;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
// ignore_for_file: avoid_setters_without_getters
|
||||
// ignore_for_file: comment_references
|
||||
// ignore_for_file: deprecated_member_use
|
||||
// ignore_for_file: deprecated_member_use_from_same_package
|
||||
// ignore_for_file: implementation_imports
|
||||
// ignore_for_file: invalid_use_of_visible_for_testing_member
|
||||
// ignore_for_file: prefer_const_constructors
|
||||
@ -46,20 +49,10 @@ class _FakeBranchReference_1 extends _i1.SmartFake
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeProcessResult_2 extends _i1.SmartFake implements _i4.ProcessResult {
|
||||
_FakeProcessResult_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [GitDir].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
class MockGitDir extends _i1.Mock implements _i4.GitDir {
|
||||
MockGitDir() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
@ -67,8 +60,12 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
@override
|
||||
String get path => (super.noSuchMethod(
|
||||
Invocation.getter(#path),
|
||||
returnValue: '',
|
||||
returnValue: _i5.dummyValue<String>(
|
||||
this,
|
||||
Invocation.getter(#path),
|
||||
),
|
||||
) as String);
|
||||
|
||||
@override
|
||||
_i6.Future<int> commitCount([String? branchName = r'HEAD']) =>
|
||||
(super.noSuchMethod(
|
||||
@ -78,6 +75,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<int>.value(0),
|
||||
) as _i6.Future<int>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i2.Commit> commitFromRevision(String? revision) =>
|
||||
(super.noSuchMethod(
|
||||
@ -93,6 +91,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.Commit>);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, _i2.Commit>> commits([String? branchName = r'HEAD']) =>
|
||||
(super.noSuchMethod(
|
||||
@ -103,6 +102,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
returnValue:
|
||||
_i6.Future<Map<String, _i2.Commit>>.value(<String, _i2.Commit>{}),
|
||||
) as _i6.Future<Map<String, _i2.Commit>>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i3.BranchReference?> branchReference(String? branchName) =>
|
||||
(super.noSuchMethod(
|
||||
@ -112,6 +112,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<_i3.BranchReference?>.value(),
|
||||
) as _i6.Future<_i3.BranchReference?>);
|
||||
|
||||
@override
|
||||
_i6.Future<List<_i3.BranchReference>> branches() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@ -121,6 +122,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
returnValue: _i6.Future<List<_i3.BranchReference>>.value(
|
||||
<_i3.BranchReference>[]),
|
||||
) as _i6.Future<List<_i3.BranchReference>>);
|
||||
|
||||
@override
|
||||
_i6.Stream<_i7.Tag> tags() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@ -129,6 +131,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Stream<_i7.Tag>.empty(),
|
||||
) as _i6.Stream<_i7.Tag>);
|
||||
|
||||
@override
|
||||
_i6.Future<List<_i8.CommitReference>> showRef({
|
||||
bool? heads = false,
|
||||
@ -146,6 +149,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
returnValue: _i6.Future<List<_i8.CommitReference>>.value(
|
||||
<_i8.CommitReference>[]),
|
||||
) as _i6.Future<List<_i8.CommitReference>>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i3.BranchReference> currentBranch() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@ -161,6 +165,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i3.BranchReference>);
|
||||
|
||||
@override
|
||||
_i6.Future<List<_i9.TreeEntry>> lsTree(
|
||||
String? treeish, {
|
||||
@ -178,6 +183,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<List<_i9.TreeEntry>>.value(<_i9.TreeEntry>[]),
|
||||
) as _i6.Future<List<_i9.TreeEntry>>);
|
||||
|
||||
@override
|
||||
_i6.Future<String?> createOrUpdateBranch(
|
||||
String? branchName,
|
||||
@ -195,6 +201,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<String?>.value(),
|
||||
) as _i6.Future<String?>);
|
||||
|
||||
@override
|
||||
_i6.Future<String> commitTree(
|
||||
String? treeSha,
|
||||
@ -210,8 +217,19 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
],
|
||||
{#parentCommitShas: parentCommitShas},
|
||||
),
|
||||
returnValue: _i6.Future<String>.value(''),
|
||||
returnValue: _i6.Future<String>.value(_i5.dummyValue<String>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#commitTree,
|
||||
[
|
||||
treeSha,
|
||||
commitMessage,
|
||||
],
|
||||
{#parentCommitShas: parentCommitShas},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<String>);
|
||||
|
||||
@override
|
||||
_i6.Future<Map<String, String>> writeObjects(List<String>? paths) =>
|
||||
(super.noSuchMethod(
|
||||
@ -221,8 +239,9 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<Map<String, String>>.value(<String, String>{}),
|
||||
) as _i6.Future<Map<String, String>>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i4.ProcessResult> runCommand(
|
||||
_i6.Future<_i10.ProcessResult> runCommand(
|
||||
Iterable<String>? args, {
|
||||
bool? throwOnError = true,
|
||||
}) =>
|
||||
@ -232,7 +251,8 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
[args],
|
||||
{#throwOnError: throwOnError},
|
||||
),
|
||||
returnValue: _i6.Future<_i4.ProcessResult>.value(_FakeProcessResult_2(
|
||||
returnValue: _i6.Future<_i10.ProcessResult>.value(
|
||||
_i5.dummyValue<_i10.ProcessResult>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#runCommand,
|
||||
@ -240,7 +260,8 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
{#throwOnError: throwOnError},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i4.ProcessResult>);
|
||||
) as _i6.Future<_i10.ProcessResult>);
|
||||
|
||||
@override
|
||||
_i6.Future<bool> isWorkingTreeClean() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
@ -249,10 +270,11 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i2.Commit?> updateBranch(
|
||||
String? branchName,
|
||||
_i6.Future<dynamic> Function(_i4.Directory)? populater,
|
||||
_i6.Future<dynamic> Function(_i10.Directory)? populater,
|
||||
String? commitMessage,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
@ -266,6 +288,7 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
|
||||
),
|
||||
returnValue: _i6.Future<_i2.Commit?>.value(),
|
||||
) as _i6.Future<_i2.Commit?>);
|
||||
|
||||
@override
|
||||
_i6.Future<_i2.Commit?> updateBranchWithDirectoryContents(
|
||||
String? branchName,
|
||||
|
Reference in New Issue
Block a user