MPS Frequently Asked Questions

Project setup

How to tell mps to use my own java classes so that i can use them inside a generator template?

To use external classes in generator templates you should setup the 'classpath' property in your generator's owner language.
In the language properties dialog find the 'class path:' section, put caret into the '...' field and press <enter> to add new entry.
Then choose path to your classes or choose jar file.
If you need more classpath entries - press <enter> again.

MPS will create one stub model for each package in your classpath. Those models will have name like: <package name>@java_stub

Before using those classes in your model you have to import corresponding stub models to your model (similar to the package importing in java).
You can do that using the model properties dialog or by hitting ctrl-M in editor (providing that one of your model's node is showing in editor).

See also MPS Project Structure

Labels

 
(None)