Skip to content

Commit ff1e7f8

Browse files
committed
Support analyzer 7.4.x and build 2.4.x
1 parent a93db6b commit ff1e7f8

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
## 5.4.7-wip
2-
3-
* Require Dart SDK ^3.7.0.
4-
51
## 5.4.6
62

73
* When formatting a generated mocks library, use the language version of the
84
library with the mockito annotation.
5+
* Require Dart SDK ^3.7.0.
6+
* Require `analyzer: '>=7.4.1 <8.0.0'`.
97

108
## 5.4.5
119

lib/src/builder.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,21 @@ class MockBuilder implements Builder {
9090

9191
final inheritanceManager = InheritanceManager3();
9292
final mockTargetGatherer = _MockTargetGatherer(
93-
entryLib,
93+
entryLib.asElement2,
9494
inheritanceManager,
9595
);
9696

9797
final assetUris = await _resolveAssetUris(
9898
buildStep.resolver,
9999
mockTargetGatherer._mockTargets,
100100
mockLibraryAsset.path,
101-
entryLib,
101+
entryLib.asElement2,
102102
);
103103

104104
final mockLibraryInfo = _MockLibraryInfo(
105105
mockTargetGatherer._mockTargets,
106106
assetUris: assetUris,
107-
entryLib: entryLib,
107+
entryLib: entryLib.asElement2,
108108
inheritanceManager: inheritanceManager,
109109
);
110110

@@ -162,7 +162,7 @@ class MockBuilder implements Builder {
162162
languageVersion: entryLib.languageVersion.effective,
163163
).format('''
164164
// Mocks generated by Mockito $packageVersion from annotations
165-
// in ${entryLib.firstFragment.source.uri.path}.
165+
// in ${entryLib.asElement2.firstFragment.source.uri.path}.
166166
// Do not manually edit this file.
167167
168168
@@ -243,7 +243,11 @@ $rawOutput
243243
final exportingLibrary = _findExportOf(librariesWithTypes, element);
244244

245245
try {
246-
final typeAssetId = await resolver.assetIdForElement(exportingLibrary);
246+
final typeAssetId = await resolver.assetIdForElement(
247+
// Use element1 until `assetIdForElement` accepts element2.
248+
// ignore: deprecated_member_use
249+
exportingLibrary.asElement,
250+
);
247251

248252
if (typeAssetId.path.startsWith('lib/')) {
249253
typeUris[element] = typeAssetId.uri.toString();

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ environment:
1313
sdk: ^3.7.0
1414

1515
dependencies:
16-
analyzer: '>=6.9.0 <8.0.0'
16+
analyzer: '>=7.4.1 <8.0.0'
1717
build: ^2.4.1
1818
code_builder: ^4.5.0
1919
collection: ^1.19.0

0 commit comments

Comments
 (0)