Post processing classes
Hi.
Is it possible to postprocess generated classes?
My usecase is to add "@Generated" annotation to every class generated by MPS.
Is it possible to postprocess generated classes?
My usecase is to add "@Generated" annotation to every class generated by MPS.
Please sign in to leave a comment.
one solution is to have another generator model "BM" which runs after your current generator model (check "Show mapping partitioning" for generator priorities). You can write a pre-processing script in BM which gets all ClassConcepts, e.g. model.roots(ClassConcept) and adds an annotation.
Be sure to set "modifies model" in your prepro script.
Best,
Dan
You can also integrate into make-process by writing a "facet" in plugin model of your language that will run "before make" and "after compile". This will allow fully-custom processing for generated code/classes/other artifacts.
Regards,
Mihail