dart-lang / mockito

Mockito-inspired mock library for Dart
https://pub.dev/packages/mockito
Apache License 2.0
630 stars 162 forks source link

Old analyzer version #570

Closed lucas404x closed 1 year ago

lucas404x commented 1 year ago

I wish to add reflectable but the last version requires analyzer 5.0 and mockito depends on 4.0.0 version of analyzer. Is there any plan to update the analyzer version?

Log Output: [Flutter] flutter pub get Running "flutter pub get" in Flutter...
Because mockito >=5.3.1 depends on analyzer ^4.6.0 and reflectable 4.0.0 depends on analyzer ^5.0.0, mockito >=5.3.1 is incompatible with reflectable 4.0.0. And because no versions of reflectable match >4.0.0 <5.0.0, mockito >=5.3.1 is incompatible with reflectable ^4.0.0. So, because prodigy_app depends on both reflectable ^4.0.0 and mockito ^5.3.1, version solving failed. pub get failed (1; So, because prodigy_app depends on both reflectable ^4.0.0 and mockito ^5.3.1, version solving failed.) exit code 1

eernstg commented 1 year ago

I don't know if this helps, but note that reflectable 3.0.9 depends on analyzer 4.2.0, so you may be able to use a slightly older version of mockito together with reflectable 3.0.9, until there is a version of mockito that works with the analyzer 5.0.0. However, analyzer 4.4.0 introduced some breaking changes (that is, it breaks reflectable), so it would need to be a version of mockito that is able to work with an analyzer whose version is strictly less than 4.4.0.

[Edit:] Just checked again, reflectable 3.0.10 works with analyzer 4.6.0.

lucas404x commented 1 year ago

Yeah, you're right. Thanks!

carloshpb commented 1 year ago

Oh please, update it so we can use it with the new version of freezed (which also depends on the analyzer 5.0) :)

srawlins commented 1 year ago

@carloshpb what are you looking for? Does mockito 5.3.1 work for you?

srawlins commented 1 year ago

Closing as complete.