Run generated classes as part of the generation process

Is it somehow possible that the generated baselanguage classes are executed at the end of the generation process?
I can start the main method with a run configuration, but since running these classes produces my final output, it would be nice to include this to the generation process. I guess I have to create a facet but I hardly found any documentation about that.
Thanks for this hint! I've give it a try, but now I've some serious problems with these facets.
At the moment I have added my target some inputs by mistake. So the next build failed with an error. I correct my mistake but then I could build the facet, because it seems to bootstrap itself. Even if I delete my facet at all I still get the same error, if I try to build my language. How do get out of this circle?
The first time if have had this, I deleted the facet, close mps and delete all contents of the *_gen directories. But this can't be the proper way.
Of course I've tried to rebuild my language and clean the java files.
My facet works fine now. I load the compiled classes to the current java process and invoke some static method using reflection.
I just wondered, if it is possible to show the resulting text files in the generated text preview window of MPS. This would be really nice. The last target of my facet does not have any output. Perhaps it can somehow return the text files as IResources?
Unfortunately, you can't just reuse the "preview generated text" since it expects the last target to be TextGen:textGenToMemory. But you can create your own preview tool, just take a look at TextPreviewModel and TextPreviewUtil.

Please sign in to leave a comment.