Skip to content

Commit 2b2992c

Browse files
authored
Allow analyzer 8. (#4118)
* Allow analyzer 8. * Fixes for analyzer 8.
1 parent ca1da49 commit 2b2992c

File tree

21 files changed

+66
-39
lines changed

21 files changed

+66
-39
lines changed

build/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 3.0.1-wip
1+
## 3.0.1
22

33
- Small improvements to RAM usage.
4+
- Allow `analyzer` 8.0.0.
45

56
## 3.0.0
67

build/lib/src/analyzer/resolver.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// ignore_for_file: deprecated_member_use until analyzer 7 support is dropped.
6+
57
import 'package:analyzer/dart/analysis/results.dart';
68
import 'package:analyzer/dart/analysis/session.dart';
79
import 'package:analyzer/dart/ast/ast.dart';

build/lib/src/builder/build_step.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import 'dart:async';
66
import 'dart:convert';
77

8+
// ignore: deprecated_member_use until analyzer 7 support is dropped.
89
import 'package:analyzer/dart/element/element2.dart';
910
import 'package:package_config/package_config_types.dart';
1011

@@ -36,6 +37,7 @@ abstract class BuildStep implements AssetReader, AssetWriter {
3637
/// await step.resolver.libraryFor(step.inputId, allowSyntaxErrors: true);
3738
/// }
3839
/// ```
40+
// ignore: deprecated_member_use until analyzer 7 support is dropped.
3941
Future<LibraryElement2> get inputLibrary;
4042

4143
/// Gets an instance provided by [resource] which is guaranteed to be unique

build/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build
2-
version: 3.0.1-wip
2+
version: 3.0.1
33
description: A package for authoring build_runner compatible code generators.
44
repository: https://github.com/dart-lang/build/tree/master/build
55
resolution: workspace
@@ -8,9 +8,9 @@ environment:
88
sdk: ^3.7.0
99

1010
dependencies:
11-
analyzer: '>=7.4.0 <8.0.0'
11+
analyzer: '>=7.4.0 <9.0.0'
1212
async: ^2.5.0
13-
build_runner_core: '9.2.1-wip'
13+
build_runner_core: '9.2.1'
1414
built_collection: ^5.1.1
1515
built_value: ^8.9.5
1616
convert: ^3.0.0

build_modules/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 5.0.16-wip
1+
## 5.0.16
22

33
- Remove unused dep: `build_config`.
4+
- Allow `analyzer` 8.0.0.
45

56
## 5.0.15
67

build_modules/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_modules
2-
version: 5.0.16-wip
2+
version: 5.0.16
33
description: >-
44
Builders to analyze and split Dart code into individually compilable modules
55
based on imports.
@@ -10,7 +10,7 @@ environment:
1010
sdk: '>=3.7.0 <3.10.0-z'
1111

1212
dependencies:
13-
analyzer: '>=5.1.0 <8.0.0'
13+
analyzer: '>=5.1.0 <9.0.0'
1414
async: ^2.5.0
1515
bazel_worker: ^1.0.0
1616
build: '>=2.0.0 <4.0.0'

build_resolvers/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 3.0.1-wip
1+
## 3.0.1
22

33
- Use `build` 3.0.1.
4+
- Allow `analyzer` 8.0.0.
45

56
## 3.0.0
67

build_resolvers/lib/src/resolver.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
// ignore_for_file: deprecated_member_use until analyzer 7 support is dropped.
6+
57
import 'dart:async';
68
import 'dart:collection';
79
import 'dart:isolate';

build_resolvers/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_resolvers
2-
version: 3.0.1-wip
2+
version: 3.0.1
33
description: Resolve Dart code in a Builder
44
repository: https://github.com/dart-lang/build/tree/master/build_resolvers
55
resolution: workspace
@@ -8,10 +8,10 @@ environment:
88
sdk: ^3.7.0
99

1010
dependencies:
11-
analyzer: '>=7.4.0 <8.0.0'
11+
analyzer: '>=7.4.0 <9.0.0'
1212
async: ^2.5.0
13-
build: '3.0.1-wip'
14-
build_runner_core: '9.2.1-wip'
13+
build: '3.0.1'
14+
build_runner_core: '9.2.1'
1515
collection: ^1.17.0
1616
convert: ^3.1.1
1717
crypto: ^3.0.0

build_resolvers/test/resolver_test.dart

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,13 @@ void runTests(ResolversFactory resolversFactory) {
668668
},
669669
(resolver) async {
670670
var main = (await resolver.findLibraryByName('web.main'))!;
671-
var meta = main.getClass2('Foo')!.supertype!.element.metadata[0];
671+
var meta =
672+
main
673+
.getClass2('Foo')!
674+
.supertype!
675+
.element3
676+
.metadata2
677+
.annotations[0];
672678
expect(meta, isNotNull);
673679
expect(meta.computeConstantValue()?.toIntValue(), 0);
674680
},
@@ -1139,8 +1145,7 @@ int? get x => 1;
11391145
expect(color.type.element!.name, equals('Color'));
11401146
expect(color.type.element!.library!.name, equals('dart.ui'));
11411147
expect(
1142-
color.type.element!.library!.definingCompilationUnit.source.uri
1143-
.toString(),
1148+
color.type.element3!.library2!.uri.toString(),
11441149
equals('dart:ui'),
11451150
);
11461151
} else {
@@ -1268,7 +1273,7 @@ int? get x => 1;
12681273
);
12691274
expect(unit, isA<FunctionDeclaration>());
12701275
expect(unit!.toSource(), 'main() {}');
1271-
expect((unit as FunctionDeclaration).declaredElement, isNull);
1276+
expect((unit as FunctionDeclaration).declaredFragment, isNull);
12721277
}, resolvers: createResolvers());
12731278
});
12741279

@@ -1283,7 +1288,11 @@ int? get x => 1;
12831288
unit,
12841289
isA<FunctionDeclaration>()
12851290
.having((fd) => fd.toSource(), 'toSource()', 'main() {}')
1286-
.having((fd) => fd.declaredElement, 'declaredElement', isNotNull),
1291+
.having(
1292+
(fd) => fd.declaredFragment,
1293+
'declaredElement',
1294+
isNotNull,
1295+
),
12871296
);
12881297
}, resolvers: createResolvers());
12891298
});
@@ -1304,7 +1313,11 @@ int? get x => 1;
13041313
(unit as CompilationUnit).declarations.single,
13051314
isA<FunctionDeclaration>()
13061315
.having((fd) => fd.toSource(), 'toSource()', 'main() {}')
1307-
.having((fd) => fd.declaredElement, 'declaredElement', isNotNull),
1316+
.having(
1317+
(fd) => fd.declaredFragment,
1318+
'declaredFragment',
1319+
isNotNull,
1320+
),
13081321
);
13091322
});
13101323
});

0 commit comments

Comments
 (0)