MapsterMapper / Mapster

A fast, fun and stimulating object to object Mapper
MIT License
4.31k stars 328 forks source link

[WIP] Add source generators and some other stuff. #409

Closed Summpot closed 2 years ago

Summpot commented 2 years ago

I added a source generator to implement the basic models generator (just copy all the properties of the original type).

I would like to use this Pull Request to track the next work.

To Do:

andrerav commented 2 years ago

Wow, this is an amazing contribution @Summpot! Is there anything you'd like me to help out with? :)

Summpot commented 2 years ago

I don't know much about the specific process that Mapster generates the corresponding Model file, and I'm not familiar with the role of configurable options. So the progress of this Pull request may not be too fast, can you help me when adding configurable options later, thank you very much.

Summpot commented 2 years ago

@andrerav I have an issue where the execution of source generators is out of order, which means that one source generator cannot access the generated code of another source generator. I have two ideas now, either generate the model and mapper in the same source generator, or generate AdaptXX as a member method of the model. Do you have any suggestions?