Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Bump source_gen 1.2.0 to 2.0.0#121

Closed
wizlif wants to merge 1 commit intoisar-community:v3from
wizlif:v3
Closed

Bump source_gen 1.2.0 to 2.0.0#121
wizlif wants to merge 1 commit intoisar-community:v3from
wizlif:v3

Conversation

@wizlif
Copy link

@wizlif wizlif commented Feb 6, 2025

No description provided.

Signed-off-by: Isaac Obella <wizlif@users.noreply.github.com>
@jslater89
Copy link

Would '>=1.2.0 <3.0.0' be a better bound here? AFAICT the 2.0.0 breaking changes don't matter—I ran the test suite successfully with both '^1.2.0' and '^2.0.0'.

@wizlif
Copy link
Author

wizlif commented Feb 13, 2025

Sure, that would be better

@jipspaul
Copy link

If you only do this, you can't use the build method:

Building package executable... (3.1s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 252ms
[WARNING] ../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/isar_analyzer.dart:149:21: Error: The getter 'enclosingElement' isn't defined for the class 'ConstructorElement'.
 - 'ConstructorElement' is from 'package:analyzer/dart/element/element.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/element.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'enclosingElement'.
        constructor.enclosingElement,
                    ^^^^^^^^^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/isar_type.dart:30:28: Error: The getter 'element2' isn't defined for the class 'DartType'.
 - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element2'.
    } else if (_isDateTime(element2!)) {
                           ^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/isar_type.dart:32:16: Error: The getter 'element2' isn't defined for the class 'DartType'.
 - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element2'.
    } else if (element2!.embeddedAnnotation != null) {
               ^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:29:40: Error: The getter 'variable' isn't defined for the class 'PropertyAccessorElement'.
 - 'PropertyAccessorElement' is from 'package:analyzer/dart/element/element.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/element.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'variable'.
      ...accessors.mapNotNull((e) => e.variable),
                                       ^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:33:56: Error: The getter 'variable' isn't defined for the class 'PropertyAccessorElement'.
 - 'PropertyAccessorElement' is from 'package:analyzer/dart/element/element.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/element.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'variable'.
            ...supertype.accessors.mapNotNull((e) => e.variable)
                                                       ^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:37:11: Error: The argument type 'bool Function(PropertyInducingElement)' can't be assigned to the parameter type 'bool Function(Object)'.
 - 'PropertyInducingElement' is from 'package:analyzer/dart/element/element.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/element.dart').
 - 'Object' is from 'dart:core'.
          (PropertyInducingElement e) =>
          ^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:43:30: Error: The getter 'name' isn't defined for the class 'Object'.
 - 'Object' is from 'dart:core'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
        .distinctBy((e) => e.name)
                             ^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:44:10: Error: A value of type 'List<Object>' can't be returned from a function with return type 'List<PropertyInducingElement>'.
 - 'List' is from 'dart:core'.
 - 'Object' is from 'dart:core'.
 - 'PropertyInducingElement' is from 'package:analyzer/dart/element/element.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/element.dart').
        .toList();
         ^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:53:27: Error: The getter 'element2' isn't defined for the class 'DartType'.
 - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element2'.
  bool get isLink => type.element2!.name == 'IsarLink';
                          ^^^^^^^^
../../.pub-cache/git/isar-7d0038e85695f8ee0534848550a42c151bfe9c5c/packages/isar_generator/lib/src/helper.dart:55:28: Error: The getter 'element2' isn't defined for the class 'DartType'.
 - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-7.3.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element2'.
  bool get isLinks => type.element2!.name == 'IsarLinks';
                           ^^^^^^^^
[INFO] Precompiling build script... completed, took 2.8s
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.```

@jipspaul
Copy link

jipspaul commented Mar 3, 2025

Hello, and news concerning this PR ?

@callumw-k
Copy link

callumw-k commented Mar 5, 2025

@jipspaul I've created a PR with more extensive changes to fix analyzer removing depreciated values. #122

If you fork my fork, you can reference the changes by adding below to your pubspec:

isar_generator:
  git:
    url: https://github.com/callumw-k/isar
    ref: v3
    path: packages/isar_generator/

swap my username with yours

@vicenterusso
Copy link
Member

This is a kickstart to our package on pubdev:

https://github.com/isar-community/isar-community

For now I updated source_gen with help from @callumw-k's PR #122

This project is a direct continuation from isar-community/isar, so it will be version 3.2.0. Nexts steps:

  • Update more packages
  • Update for 16KB page size
  • Finally publish minimal acceptable version

I really want PRs for that new repo. All tests are passing so we must keep 100% of tests green

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants