From a6fb5b399ca87ca08c6918abbfd51f6e205b6758 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Wed, 14 Jan 2026 09:57:17 +0100 Subject: [PATCH 1/2] Require analyzer 10. --- CHANGELOG.md | 5 ++++ benchmark/pubspec.yaml | 11 ++++++++ built_value/pubspec.yaml | 9 ++++++ .../lib/src/enum_source_field.dart | 4 +-- .../lib/src/value_source_class.dart | 28 +++++-------------- .../lib/src/value_source_field.dart | 13 +++------ built_value_generator/pubspec.yaml | 11 +++++++- built_value_test/pubspec.yaml | 11 ++++++++ chat_example/pubspec.yaml | 11 ++++++++ end_to_end_test/pubspec.yaml | 11 ++++++++ example/pubspec.yaml | 11 ++++++++ 11 files changed, 91 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 384a34d5..efe41afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +# 8.12.3 + +- Require `analyzer ^10.0.0`, stop using removed and deprecated methods from + earlier versions. + # 8.12.2 - Allow `analyzer 10.0.0`. diff --git a/benchmark/pubspec.yaml b/benchmark/pubspec.yaml index bfbc6104..9d44463f 100644 --- a/benchmark/pubspec.yaml +++ b/benchmark/pubspec.yaml @@ -18,3 +18,14 @@ dev_dependencies: pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0 + +dependency_overrides: + built_value: + path: ../built_value + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 diff --git a/built_value/pubspec.yaml b/built_value/pubspec.yaml index 7b78b6e0..accdb1bd 100644 --- a/built_value/pubspec.yaml +++ b/built_value/pubspec.yaml @@ -19,3 +19,12 @@ dependencies: dev_dependencies: pedantic: ^1.4.0 test: ^1.16.0 + +dependency_overrides: + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 diff --git a/built_value_generator/lib/src/enum_source_field.dart b/built_value_generator/lib/src/enum_source_field.dart index fa273213..2065637d 100644 --- a/built_value_generator/lib/src/enum_source_field.dart +++ b/built_value_generator/lib/src/enum_source_field.dart @@ -73,9 +73,7 @@ abstract class EnumSourceField var enumName = classElement.displayName; for (var fieldElement in classElement.fields) { final type = DartTypes.tryGetName(fieldElement.getter?.returnType); - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - if (!fieldElement.isSynthetic && + if (fieldElement.isOriginDeclaration && (type == enumName || type == 'dynamic')) { result.add(EnumSourceField(parsedLibrary, fieldElement)); } diff --git a/built_value_generator/lib/src/value_source_class.dart b/built_value_generator/lib/src/value_source_class.dart index 7a2cfe37..6fa1fa4c 100644 --- a/built_value_generator/lib/src/value_source_class.dart +++ b/built_value_generator/lib/src/value_source_class.dart @@ -111,9 +111,7 @@ abstract class ValueSourceClass // Base class must have no fields. if (supertype.element.fields.any( - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - (field) => !field.isStatic && !field.isSynthetic, + (field) => !field.isStatic && field.isOriginDeclaration, )) { return false; } @@ -293,9 +291,7 @@ abstract class ValueSourceClass element.constructors .where( (constructor) => - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - !constructor.isFactory && !constructor.isSynthetic, + !constructor.isFactory && constructor.isOriginDeclaration, ) .map( (constructor) => parsedLibrary @@ -322,9 +318,7 @@ abstract class ValueSourceClass builderElement!.constructors .where( (constructor) => - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - !constructor.isFactory && !constructor.isSynthetic, + !constructor.isFactory && constructor.isOriginDeclaration, ) .map( (constructor) => parsedLibrary @@ -552,9 +546,7 @@ abstract class ValueSourceClass GeneratorError( (b) => b ..message = 'Make class implement $expectedInterface.' - // TODO(davidmorgan): update when support for analyzer 8 is removed. - // ignore: deprecated_member_use - ..offset = classDeclaration.leftBracket.offset - 1 + ..offset = classDeclaration.body.offset - 1 ..length = 0 ..fix = 'implements $expectedInterface', ), @@ -683,9 +675,7 @@ abstract class ValueSourceClass (b) => b ..message = 'Make class have exactly one constructor: $expectedConstructor;' - // TODO(davidmorgan): update when support for analyzer 8 is removed. - // ignore: deprecated_member_use - ..offset = classDeclaration.rightBracket.offset + ..offset = classDeclaration.body.endToken.offset ..length = 0 ..fix = ' $expectedConstructor;\n', ), @@ -713,9 +703,7 @@ abstract class ValueSourceClass (b) => b ..message = 'Make class have exactly one constructor: $expectedConstructor;' - // TODO(davidmorgan): update when support for analyzer 8 is removed. - // ignore: deprecated_member_use - ..offset = classDeclaration.rightBracket.offset + ..offset = classDeclaration.body.endToken.offset ..length = 0 ..fix = ' $expectedConstructor;\n', ), @@ -760,9 +748,7 @@ abstract class ValueSourceClass ..message = 'Add a factory so your class can be instantiated. Example:\n\n' '$exampleFactory' - // TODO(davidmorgan): update when support for analyzer 8 is removed. - // ignore: deprecated_member_use - ..offset = classDeclaration.rightBracket.offset + ..offset = classDeclaration.body.endToken.offset ..length = 0 ..fix = ' $exampleFactory\n', ), diff --git a/built_value_generator/lib/src/value_source_field.dart b/built_value_generator/lib/src/value_source_field.dart index 2197c1aa..3d3ed728 100644 --- a/built_value_generator/lib/src/value_source_field.dart +++ b/built_value_generator/lib/src/value_source_field.dart @@ -99,9 +99,8 @@ abstract class ValueSourceField } @memoized - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - bool get isGetter => element.getter != null && !element.getter!.isSynthetic; + bool get isGetter => + element.getter != null && element.getter!.isOriginDeclaration; @memoized bool get hasNullableAnnotation => element.getter!.metadata.annotations.any( @@ -148,9 +147,7 @@ abstract class ValueSourceField builderFieldExists && builderElement!.getter != null && !builderElement!.getter!.isAbstract && - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - builderElement!.getter!.isSynthetic; + !builderElement!.getter!.isOriginDeclaration; @memoized bool get builderFieldIsGetterSetterPair => @@ -292,9 +289,7 @@ abstract class ValueSourceField for (var field in collectFields(classElement)) { if (!field.isStatic && field.getter != null && - // TODO(davidmorgan): update when support for analyzer 9 is removed. - // ignore: deprecated_member_use - (field.getter!.isAbstract || field.getter!.isSynthetic)) { + (field.getter!.isAbstract || !field.getter!.isOriginDeclaration)) { final builderField = builderClassElement?.getField(field.name!); result.add( ValueSourceField( diff --git a/built_value_generator/pubspec.yaml b/built_value_generator/pubspec.yaml index 9acdbd40..5c12cc66 100644 --- a/built_value_generator/pubspec.yaml +++ b/built_value_generator/pubspec.yaml @@ -13,7 +13,7 @@ environment: sdk: '>=3.6.0 <4.0.0' dependencies: - analyzer: '>=8.1.1 <11.0.0' + analyzer: ^10.0.0 build: '>=3.0.0 <5.0.0' build_config: ^1.2.0 built_collection: ^5.0.0 @@ -27,3 +27,12 @@ dev_dependencies: logging: ^1.3.0 pedantic: ^1.4.0 test: ^1.0.0 + +dependency_overrides: + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 + built_value: + path: ../built_value diff --git a/built_value_test/pubspec.yaml b/built_value_test/pubspec.yaml index 0603de35..e1bdb5ce 100644 --- a/built_value_test/pubspec.yaml +++ b/built_value_test/pubspec.yaml @@ -25,3 +25,14 @@ dev_dependencies: build_runner: '>=1.0.0 <3.0.0' pedantic: ^1.4.0 test: ^1.0.0 + +dependency_overrides: + built_value: + path: ../built_value + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 diff --git a/chat_example/pubspec.yaml b/chat_example/pubspec.yaml index 12811bbd..f7fd1736 100644 --- a/chat_example/pubspec.yaml +++ b/chat_example/pubspec.yaml @@ -24,3 +24,14 @@ dev_dependencies: built_value_generator: ^8.12.2 pedantic: ^1.4.0 test: ^1.0.0 + +dependency_overrides: + built_value: + path: ../built_value + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 diff --git a/end_to_end_test/pubspec.yaml b/end_to_end_test/pubspec.yaml index f915f9cf..973d7813 100644 --- a/end_to_end_test/pubspec.yaml +++ b/end_to_end_test/pubspec.yaml @@ -20,3 +20,14 @@ dev_dependencies: pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.16.0 + +dependency_overrides: + built_value: + path: ../built_value + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 48c96a03..fce74b88 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -17,3 +17,14 @@ dev_dependencies: pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0 + +dependency_overrides: + built_value: + path: ../built_value + built_value_generator: + path: ../built_value_generator + analyzer: ^10.0.0 + dart_style: + git: + url: https://github.com/dart-lang/dart_style.git + ref: af2e770 From 5d5b5822188f1c13f69c91d78ca8c3c114f4677f Mon Sep 17 00:00:00 2001 From: David Morgan Date: Wed, 14 Jan 2026 10:34:35 +0100 Subject: [PATCH 2/2] Release 8.12.3. --- benchmark/pubspec.yaml | 15 ++------------- built_value/pubspec.yaml | 11 +---------- built_value_generator/pubspec.yaml | 11 +---------- built_value_test/pubspec.yaml | 15 ++------------- chat_example/pubspec.yaml | 15 ++------------- end_to_end_test/pubspec.yaml | 15 ++------------- example/pubspec.yaml | 13 +------------ 7 files changed, 11 insertions(+), 84 deletions(-) diff --git a/benchmark/pubspec.yaml b/benchmark/pubspec.yaml index 9d44463f..013524e8 100644 --- a/benchmark/pubspec.yaml +++ b/benchmark/pubspec.yaml @@ -1,5 +1,5 @@ name: benchmark -version: 8.12.2 +version: 8.12.3 publish_to: none description: > Benchmark, not for publishing. @@ -14,18 +14,7 @@ dependencies: dev_dependencies: build_runner: '>=1.0.0 <3.0.0' - built_value_generator: ^8.12.2 + built_value_generator: ^8.12.3 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0 - -dependency_overrides: - built_value: - path: ../built_value - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 diff --git a/built_value/pubspec.yaml b/built_value/pubspec.yaml index accdb1bd..689539dc 100644 --- a/built_value/pubspec.yaml +++ b/built_value/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value -version: 8.12.2 +version: 8.12.3 description: > Value types with builders, Dart classes as enums, and serialization. This library is the runtime dependency. @@ -19,12 +19,3 @@ dependencies: dev_dependencies: pedantic: ^1.4.0 test: ^1.16.0 - -dependency_overrides: - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 diff --git a/built_value_generator/pubspec.yaml b/built_value_generator/pubspec.yaml index 5c12cc66..ddcfb874 100644 --- a/built_value_generator/pubspec.yaml +++ b/built_value_generator/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value_generator -version: 8.12.2 +version: 8.12.3 description: > Value types with builders, Dart classes as enums, and serialization. This library is the dev dependency. @@ -27,12 +27,3 @@ dev_dependencies: logging: ^1.3.0 pedantic: ^1.4.0 test: ^1.0.0 - -dependency_overrides: - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 - built_value: - path: ../built_value diff --git a/built_value_test/pubspec.yaml b/built_value_test/pubspec.yaml index e1bdb5ce..535317a0 100644 --- a/built_value_test/pubspec.yaml +++ b/built_value_test/pubspec.yaml @@ -1,5 +1,5 @@ name: built_value_test -version: 8.12.2 +version: 8.12.3 description: > Value types with builders, Dart classes as enums, and serialization. This library provides test support. @@ -21,18 +21,7 @@ dependencies: quiver: '>=0.21.0 <4.0.0' dev_dependencies: - built_value_generator: ^8.12.2 + built_value_generator: ^8.12.3 build_runner: '>=1.0.0 <3.0.0' pedantic: ^1.4.0 test: ^1.0.0 - -dependency_overrides: - built_value: - path: ../built_value - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 diff --git a/chat_example/pubspec.yaml b/chat_example/pubspec.yaml index f7fd1736..9ff06f88 100644 --- a/chat_example/pubspec.yaml +++ b/chat_example/pubspec.yaml @@ -1,5 +1,5 @@ name: chat_example -version: 8.12.2 +version: 8.12.3 publish_to: none description: > Just an example, not for publishing. @@ -21,17 +21,6 @@ dev_dependencies: build_runner: any build_test: any build_web_compilers: any - built_value_generator: ^8.12.2 + built_value_generator: ^8.12.3 pedantic: ^1.4.0 test: ^1.0.0 - -dependency_overrides: - built_value: - path: ../built_value - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 diff --git a/end_to_end_test/pubspec.yaml b/end_to_end_test/pubspec.yaml index 973d7813..70d37617 100644 --- a/end_to_end_test/pubspec.yaml +++ b/end_to_end_test/pubspec.yaml @@ -1,5 +1,5 @@ name: end_to_end_test -version: 8.12.2 +version: 8.12.3 publish_to: none description: > Tests, not for publishing. @@ -15,19 +15,8 @@ dependencies: dev_dependencies: build: '>=3.1.0 <5.0.0' build_runner: '>=2.5.0 <3.0.0' - built_value_generator: ^8.12.2 + built_value_generator: ^8.12.3 fixnum: ^1.0.0 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.16.0 - -dependency_overrides: - built_value: - path: ../built_value - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770 diff --git a/example/pubspec.yaml b/example/pubspec.yaml index fce74b88..b1862ba1 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -13,18 +13,7 @@ dependencies: dev_dependencies: build_runner: '>=1.0.0 <3.0.0' - built_value_generator: ^8.12.2 + built_value_generator: ^8.12.3 pedantic: ^1.4.0 quiver: '>=0.21.0 <4.0.0' test: ^1.0.0 - -dependency_overrides: - built_value: - path: ../built_value - built_value_generator: - path: ../built_value_generator - analyzer: ^10.0.0 - dart_style: - git: - url: https://github.com/dart-lang/dart_style.git - ref: af2e770