- Dmitry Sidorenko
- 10/12/11
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.
- daniel sti
- 10/13/11
Hi Dmitry,
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
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
- Evgeny Gryaznov
- 10/23/11
It is better to use post-processing script. Create a separate mapping configuration with a post-processing script. It should be applied when everything is reduced to baseLanguage. So, add priority: your mapping configuration = baseLanguage.
- Mihail Muhin
- 10/13/11
Dmitry,
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
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