2

I am developing a plugin for Schedulability Analysis for mbeddr. In order to run an external tool, I want to transform the mbeddr-model to the external tool's model and use the Textgen aspect in order to create an input file for the external tool. The Analysis will be started from an Action defined in a plugin solution (is this the smartest way?), so how do I trigger the M2M transformation and the textgen from a plugin action?

Thanks

Achim Stuy
  • 53
  • 8

1 Answers1

1

You can have a look at the MakeActionImpl Class from MPS. It basically does it by creating a MakeSession it takes a list of models to generate and you can await the Future that is returned. You need fine grained control about the generators invoked and the facets involved have a look at the MakeUtils from com.mbeddr.core.runconfiguration.pluginSolution It's a good blueprint if you want get deeper integration with the MPS internals. It also contains a easy API to do the simple rebuild/make tasks.

Kolja
  • 2,307
  • 15
  • 23
  • Thank you for your fast reply. It looks promising.. I guess, I'll have to call the `makeProject(...)` taking some `parameters`? Which parameters can I add? Is there any example? – Achim Stuy Sep 15 '17 at 06:08
  • Exactly, there are some example in the analyses projects of mbeddr. But the parameters are pretty self explaining in the simple cases. Is just if mps should regenerate the models or not. Which has basically no effect on mbeddr models because we don't support change tracking from MPS and MPS will always regenerate the models, regardless if they are up to date or not. – Kolja Sep 19 '17 at 09:47
  • This would generate the project as usual, but I need it to be transformed into my model and that be textgenerated. I investigated the `MakeUtils` a little bit and found it is using a `GeneratorFacade` (com.mbeddr.mpsutil) which I can give a [`GenerationPlan`](https://confluence.jetbrains.com/display/MPSD20172/Generation+plan). Now the project is transformed into my model (language), but the TextGen is not invoked. What could be the problem? – Achim Stuy Sep 27 '17 at 11:10
  • Okay, I need not only to generate the project but also make it. Now I added the make but everytime I start it, mbeddr halts or rather does no longer respond. – Achim Stuy Sep 27 '17 at 14:57