dart_mappable icon indicating copy to clipboard operation
dart_mappable copied to clipboard

[Enhancement] Show more warnings in the build_runner logs

Open lucavenir opened this issue 3 years ago • 3 comments

Hi there,

[version: 2.0.0-dev5]

I often find myself frustrated because I can't wrap my head around why dart_mappable isn't able to generate code for my classes.

This happens because of:

  1. My clear lack of experience with these API, whereas some documentation (and examples, cookbooks, etc.) would help
  2. The complete absence of feedback when launching build_runner

This drives me in a situation where I can't seem to isolate problems or bugs from my side. At this very moment I have a piece of code that is working correctly in a sandbox, but I can't make it work on my production app. This is all because there are no logs onto why some code isn't generating.

Thanks in advance

lucavenir avatar Oct 28 '22 23:10 lucavenir

Yes I'd love to improve this. Anything specific where you have problems or think the documentation can be improved?

schultek avatar Oct 29 '22 11:10 schultek

On the docs I can open a separate issue and a PR with some improvements I'd like to add. The first that comes to my mind is the specification on how codegen works on this project, i.e. you have to use the classes you're defining, or you won't get any code.

lucavenir avatar Oct 29 '22 13:10 lucavenir

Currently the builder cannot detect annotated classes that are not imported, so it also cannot warn about them. It's a tricky situation.

But I can try to make the docs more clear.

schultek avatar Oct 29 '22 18:10 schultek

This behavior now changes in version 2 (see prerelease 2.0.0-dev.7), so this should not be a problem anymore.

schultek avatar Jan 02 '23 20:01 schultek