Skip to content

Allow analyzer 8. #4118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 3.0.1-wip
## 3.0.1

- Small improvements to RAM usage.
- Allow `analyzer` 8.0.0.

## 3.0.0

Expand Down
2 changes: 2 additions & 0 deletions build/lib/src/analyzer/resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: deprecated_member_use until analyzer 7 support is dropped.

import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/dart/ast/ast.dart';
Expand Down
2 changes: 2 additions & 0 deletions build/lib/src/builder/build_step.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert';

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

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

/// Gets an instance provided by [resource] which is guaranteed to be unique
Expand Down
6 changes: 3 additions & 3 deletions build/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build
version: 3.0.1-wip
version: 3.0.1
description: A package for authoring build_runner compatible code generators.
repository: https://github.com/dart-lang/build/tree/master/build
resolution: workspace
Expand All @@ -8,9 +8,9 @@ environment:
sdk: ^3.7.0

dependencies:
analyzer: '>=7.4.0 <8.0.0'
analyzer: '>=7.4.0 <9.0.0'
async: ^2.5.0
build_runner_core: '9.2.1-wip'
build_runner_core: '9.2.1'
built_collection: ^5.1.1
built_value: ^8.9.5
convert: ^3.0.0
Expand Down
3 changes: 2 additions & 1 deletion build_modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 5.0.16-wip
## 5.0.16

- Remove unused dep: `build_config`.
- Allow `analyzer` 8.0.0.

## 5.0.15

Expand Down
4 changes: 2 additions & 2 deletions build_modules/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_modules
version: 5.0.16-wip
version: 5.0.16
description: >-
Builders to analyze and split Dart code into individually compilable modules
based on imports.
Expand All @@ -10,7 +10,7 @@ environment:
sdk: '>=3.7.0 <3.10.0-z'

dependencies:
analyzer: '>=5.1.0 <8.0.0'
analyzer: '>=5.1.0 <9.0.0'
async: ^2.5.0
bazel_worker: ^1.0.0
build: '>=2.0.0 <4.0.0'
Expand Down
3 changes: 2 additions & 1 deletion build_resolvers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 3.0.1-wip
## 3.0.1

- Use `build` 3.0.1.
- Allow `analyzer` 8.0.0.

## 3.0.0

Expand Down
2 changes: 2 additions & 0 deletions build_resolvers/lib/src/resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: deprecated_member_use until analyzer 7 support is dropped.

import 'dart:async';
import 'dart:collection';
import 'dart:isolate';
Expand Down
8 changes: 4 additions & 4 deletions build_resolvers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_resolvers
version: 3.0.1-wip
version: 3.0.1
description: Resolve Dart code in a Builder
repository: https://github.com/dart-lang/build/tree/master/build_resolvers
resolution: workspace
Expand All @@ -8,10 +8,10 @@ environment:
sdk: ^3.7.0

dependencies:
analyzer: '>=7.4.0 <8.0.0'
analyzer: '>=7.4.0 <9.0.0'
async: ^2.5.0
build: '3.0.1-wip'
build_runner_core: '9.2.1-wip'
build: '3.0.1'
build_runner_core: '9.2.1'
collection: ^1.17.0
convert: ^3.1.1
crypto: ^3.0.0
Expand Down
25 changes: 19 additions & 6 deletions build_resolvers/test/resolver_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,13 @@ void runTests(ResolversFactory resolversFactory) {
},
(resolver) async {
var main = (await resolver.findLibraryByName('web.main'))!;
var meta = main.getClass2('Foo')!.supertype!.element.metadata[0];
var meta =
main
.getClass2('Foo')!
.supertype!
.element3
.metadata2
.annotations[0];
expect(meta, isNotNull);
expect(meta.computeConstantValue()?.toIntValue(), 0);
},
Expand Down Expand Up @@ -1139,8 +1145,7 @@ int? get x => 1;
expect(color.type.element!.name, equals('Color'));
expect(color.type.element!.library!.name, equals('dart.ui'));
expect(
color.type.element!.library!.definingCompilationUnit.source.uri
.toString(),
color.type.element3!.library2!.uri.toString(),
equals('dart:ui'),
);
} else {
Expand Down Expand Up @@ -1268,7 +1273,7 @@ int? get x => 1;
);
expect(unit, isA<FunctionDeclaration>());
expect(unit!.toSource(), 'main() {}');
expect((unit as FunctionDeclaration).declaredElement, isNull);
expect((unit as FunctionDeclaration).declaredFragment, isNull);
}, resolvers: createResolvers());
});

Expand All @@ -1283,7 +1288,11 @@ int? get x => 1;
unit,
isA<FunctionDeclaration>()
.having((fd) => fd.toSource(), 'toSource()', 'main() {}')
.having((fd) => fd.declaredElement, 'declaredElement', isNotNull),
.having(
(fd) => fd.declaredFragment,
'declaredElement',
isNotNull,
),
);
}, resolvers: createResolvers());
});
Expand All @@ -1304,7 +1313,11 @@ int? get x => 1;
(unit as CompilationUnit).declarations.single,
isA<FunctionDeclaration>()
.having((fd) => fd.toSource(), 'toSource()', 'main() {}')
.having((fd) => fd.declaredElement, 'declaredElement', isNotNull),
.having(
(fd) => fd.declaredFragment,
'declaredFragment',
isNotNull,
),
);
});
});
Expand Down
2 changes: 1 addition & 1 deletion build_runner/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.6.1-wip
## 2.6.1

- Use `build` 3.0.1.

Expand Down
6 changes: 3 additions & 3 deletions build_runner/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_runner
version: 2.6.1-wip
version: 2.6.1
description: A build system for Dart code generation and modular compilation.
repository: https://github.com/dart-lang/build/tree/master/build_runner
resolution: workspace
Expand All @@ -15,10 +15,10 @@ platforms:
dependencies:
args: ^2.0.0
async: ^2.5.0
build: '3.0.1-wip'
build: '3.0.1'
build_config: ">=1.1.0 <1.2.0"
build_daemon: ^4.0.0
build_runner_core: '9.2.1-wip'
build_runner_core: '9.2.1'
code_builder: ^4.2.0
crypto: ^3.0.0
dart_style: '>=2.3.7 <4.0.0'
Expand Down
3 changes: 2 additions & 1 deletion build_runner_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 9.2.1-wip
## 9.2.1

- Use `build` 3.0.1.
- Allow `analyzer` 8.0.0.

## 9.2.0

Expand Down
2 changes: 2 additions & 0 deletions build_runner_core/lib/src/generate/build_step_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// ignore_for_file: deprecated_member_use until analyzer 7 support is dropped.

import 'dart:async';
import 'dart:collection';
import 'dart:convert';
Expand Down
10 changes: 5 additions & 5 deletions build_runner_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_runner_core
version: 9.2.1-wip
version: 9.2.1
description: Core tools to organize the structure of a build and run Builders.
repository: https://github.com/dart-lang/build/tree/master/build_runner_core
resolution: workspace
Expand All @@ -13,12 +13,12 @@ platforms:
macos:

dependencies:
analyzer: '>=6.9.0 <8.0.0'
analyzer: '>=6.9.0 <9.0.0'
async: ^2.5.0
build: '3.0.1-wip'
build: '3.0.1'
build_config: ^1.0.0
build_resolvers: '3.0.1-wip'
build_runner: '2.6.1-wip'
build_resolvers: '3.0.1'
build_runner: '2.6.1'
built_collection: ^5.1.1
built_value: ^8.10.1
collection: ^1.15.0
Expand Down
3 changes: 2 additions & 1 deletion build_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 3.3.1-wip
## 3.3.1

- Use `build` 3.0.1.
- Allow `analyzer` 8.0.0.

## 3.3.0

Expand Down
10 changes: 5 additions & 5 deletions build_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: build_test
description: Utilities for writing unit tests of Builders.
version: 3.3.1-wip
version: 3.3.1
repository: https://github.com/dart-lang/build/tree/master/build_test
resolution: workspace

environment:
sdk: ^3.7.0

dependencies:
build: '3.0.1-wip'
build: '3.0.1'
build_config: ^1.0.0
build_resolvers: '3.0.1-wip'
build_runner_core: '9.2.1-wip'
build_resolvers: '3.0.1'
build_runner_core: '9.2.1'
crypto: ^3.0.0
glob: ^2.0.0
html: ^0.15.0
Expand All @@ -25,7 +25,7 @@ dependencies:
watcher: ^1.0.0

dev_dependencies:
analyzer: '>=5.2.0 <8.0.0'
analyzer: '>=5.2.0 <9.0.0'

topics:
- build-runner
Expand Down
2 changes: 1 addition & 1 deletion build_test/test/resolve_source_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void main() {
}

String _toStringId(InterfaceType t) =>
'${t.element.source.uri.toString().split('/').first}#${t.element.name}';
'${t.element3.library2.uri.toString().split('/').first}#${t.element.name}';

extension on Resolver {
Future<LibraryElement2> findLibraryNotNull(String name) async {
Expand Down
3 changes: 2 additions & 1 deletion build_web_compilers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 4.2.1-wip
## 4.2.1

- Remove unused deps: `build_config`.
- Allow `analyzer` 8.0.0.

## 4.2.0

Expand Down
4 changes: 2 additions & 2 deletions build_web_compilers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_web_compilers
version: 4.2.1-wip
version: 4.2.1
description: Builder implementations wrapping the dart2js and DDC compilers.
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers
resolution: workspace
Expand All @@ -8,7 +8,7 @@ environment:
sdk: '>=3.7.0 <3.10.0-z'

dependencies:
analyzer: '>=5.1.0 <8.0.0'
analyzer: '>=5.1.0 <9.0.0'
archive: '>=3.0.0 <5.0.0'
bazel_worker: ^1.0.0
build: '>=2.0.0 <4.0.0'
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ environment:
resolution: workspace

dependencies:
analyzer: ">=5.0.0 <8.0.0"
analyzer: ">=5.0.0 <9.0.0"
build: ^3.0.0
# Not imported in code, but used to constrain `build.yaml` requirements
build_config: ^1.0.0
Expand Down
Loading