Skip to content
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

fix analyzer deprecations #3376

Merged
merged 3 commits into from Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions build_modules/CHANGELOG.md
@@ -1,3 +1,7 @@
## 4.0.7-dev

- Migrate off deprecated analyzer apis.

## 4.0.6

- Allow the latest `package:analyzer`.
Expand Down
2 changes: 1 addition & 1 deletion build_modules/lib/src/module_library.dart
Expand Up @@ -238,6 +238,6 @@ bool _isPart(CompilationUnit dart) =>
// but has a part that does, or it exports a `main` from another library.
bool _hasMainMethod(CompilationUnit dart) => dart.declarations.any((node) =>
node is FunctionDeclaration &&
node.name2.lexeme == 'main' &&
node.name.lexeme == 'main' &&
node.functionExpression.parameters != null &&
node.functionExpression.parameters!.parameters.length <= 2);
6 changes: 3 additions & 3 deletions build_modules/pubspec.yaml
@@ -1,13 +1,13 @@
name: build_modules
version: 4.0.6
version: 4.0.7-dev
description: Builders for Dart modules
repository: https://github.com/dart-lang/build/tree/master/build_modules

environment:
sdk: ">=2.14.0 <3.0.0"
sdk: '>=2.14.0 <3.0.0'

dependencies:
analyzer: '>=4.4.0 <6.0.0'
analyzer: '>=5.1.0 <6.0.0'
async: ^2.5.0
bazel_worker: ^1.0.0
build: ^2.0.0
Expand Down
4 changes: 4 additions & 0 deletions build_resolvers/CHANGELOG.md
@@ -1,3 +1,7 @@
## 2.0.11-dev

- Migrate off deprecated analyzer apis.

## 2.0.10

- Migrate from `LibraryElement#parts` to `LibraryElement#parts2`.
Expand Down
8 changes: 4 additions & 4 deletions build_resolvers/pubspec.yaml
@@ -1,17 +1,17 @@
name: build_resolvers
version: 2.0.10
version: 2.0.11-dev
description: Resolve Dart code in a Builder
repository: https://github.com/dart-lang/build/tree/master/build_resolvers

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: '>=2.17.0 <3.0.0'

dependencies:
analyzer: '>=4.6.0 <6.0.0'
analyzer: '>=5.1.0 <6.0.0'
async: ^2.5.0
build: ^2.0.0
crypto: ^3.0.0
graphs: ">=1.0.0 <3.0.0"
graphs: '>=1.0.0 <3.0.0'
logging: ^1.0.0
path: ^1.8.0
package_config: ^2.0.0
Expand Down
7 changes: 3 additions & 4 deletions build_resolvers/test/resolver_test.dart
Expand Up @@ -733,7 +733,7 @@ int? get x => 1;
expect(
unit.declarations.first,
isA<FunctionDeclaration>()
.having((d) => d.name2.lexeme, 'main', 'main'));
.having((d) => d.name.lexeme, 'main', 'main'));
}, resolvers: AnalyzerResolvers());
});
});
Expand All @@ -747,7 +747,7 @@ int? get x => 1;
var unit = await resolver.astNodeFor(lib.topLevelElements.first);
expect(unit, isA<FunctionDeclaration>());
expect(unit!.toSource(), 'main() {}');
expect((unit as FunctionDeclaration).declaredElement2, isNull);
expect((unit as FunctionDeclaration).declaredElement, isNull);
}, resolvers: AnalyzerResolvers());
});

Expand All @@ -762,8 +762,7 @@ int? get x => 1;
unit,
isA<FunctionDeclaration>()
.having((fd) => fd.toSource(), 'toSource()', 'main() {}')
.having(
(fd) => fd.declaredElement2, 'declaredElement', isNotNull),
.having((fd) => fd.declaredElement, 'declaredElement', isNotNull),
);
}, resolvers: AnalyzerResolvers());
});
Expand Down
4 changes: 4 additions & 0 deletions build_vm_compilers/CHANGELOG.md
@@ -1,3 +1,7 @@
## 1.0.13-dev

- Migrate off deprecated analyzer apis.

## 1.0.12

- Allow the latest `package:analyzer`.
Expand Down
2 changes: 1 addition & 1 deletion build_vm_compilers/lib/src/vm_entrypoint_builder.dart
Expand Up @@ -94,7 +94,7 @@ Future<bool> _isAppEntryPoint(AssetId dartId, AssetReader reader) async {
// but has a part that does, or it exports a `main` from another library.
return parsed.declarations.any((node) {
return node is FunctionDeclaration &&
node.name2.lexeme == 'main' &&
node.name.lexeme == 'main' &&
node.functionExpression.parameters != null &&
node.functionExpression.parameters!.parameters.length <= 2;
});
Expand Down
6 changes: 3 additions & 3 deletions build_vm_compilers/pubspec.yaml
@@ -1,13 +1,13 @@
name: build_vm_compilers
version: 1.0.12
version: 1.0.13-dev
description: Builder implementations wrapping Dart VM compilers.
repository: https://github.com/dart-lang/build/tree/master/build_vm_compilers

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: '>=2.17.0 <3.0.0'

dependencies:
analyzer: '>=4.4.0 <6.0.0'
analyzer: '>=5.1.0 <6.0.0'
build: ^2.0.0
build_config: ^1.0.0
build_modules: ^4.0.0
Expand Down
4 changes: 4 additions & 0 deletions build_web_compilers/CHANGELOG.md
@@ -1,3 +1,7 @@
## 3.2.7-dev

- Migrate off deprecated analyzer apis.

## 3.2.6

- Allow the latest `package:analyzer`.
Expand Down
2 changes: 1 addition & 1 deletion build_web_compilers/lib/src/web_entrypoint_builder.dart
Expand Up @@ -181,7 +181,7 @@ Future<bool> _isAppEntryPoint(AssetId dartId, AssetReader reader) async {
// but has a part that does, or it exports a `main` from another library.
return parsed.declarations.any((node) {
return node is FunctionDeclaration &&
node.name2.lexeme == 'main' &&
node.name.lexeme == 'main' &&
node.functionExpression.parameters != null &&
node.functionExpression.parameters!.parameters.length <= 2;
});
Expand Down
6 changes: 3 additions & 3 deletions build_web_compilers/pubspec.yaml
@@ -1,13 +1,13 @@
name: build_web_compilers
version: 3.2.6
version: 3.2.7-dev
description: Builder implementations wrapping Dart compilers.
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers

environment:
sdk: ">=2.17.0 <3.0.0"
sdk: '>=2.17.0 <3.0.0'

dependencies:
analyzer: '>=4.4.0 <6.0.0'
analyzer: '>=5.1.0 <6.0.0'
archive: ^3.0.0
bazel_worker: ^1.0.0
build: ^2.0.0
Expand Down