Module repositories

What is the recommended way of managing external MPS modules, besides manual setup?

 

For example, is it possible to use a (possibly private) module repository to automatically manage all modules written from within MPS, as well as their dependencies, akin to the maven repository for all JVM artifacts? Or could a maven repository be reused for this purpose?

 

I am about to write a tool to improve my situation, but I wonder if there are better options.

 

Thanks in advance.

6 comments
Comment actions Permalink

It depends on what you are going to use the repository for. For dependency management Maven works fine (e.g. MPS-extensions and mbeddr platform are both available via itemis Nexus Maven repository at http://projects.itemis.de/nexus). I have a sample project at https://github.com/specificlanguages/mps-maven-sample-2019.2 that you could have a look at.

If you want a plugin repository so that your end-users can install plugins via the IDE's Settings -> Plugins tab, you'll need an open web server and a couple of XML files.

1
Comment actions Permalink

Thanks for the pointer.

 

Actually I was considering managing the dependencies of the modules of the defined language, but not those of the Java artifacts or MPS plugins.

 

The "zip" typed maven dependency seems to be a solution, but I do not know if they are transitive. I guess currently the simplest solution is to manage all such modules in a monolithic huge repository with different modules isolated by solutions in the repository.

0
Comment actions Permalink

I’m not quite following. What are the modules of the defined language? Are they not MPS solutions?

0
Comment actions Permalink

Yes, they are MPS solutions. I mean, say I am defining module A in my own solution, and it requires module B from another solution, which is not in my project. Module B itself may in turn depend on another module C in a solution of yet another project, and so on. So all of the modules, defined in different solutions in different projects, form a hierachy.

 

Currently, the only way that I am aware of to manage external modules in MPS is to download them manually, and set them up in Preferences -> Build, Execution, Deployment -> Project Libraries or Global Libraries. After that, each and every dependency can be set for respective solutions or aspects. For a handful of modules, this is okay, but if the number of such modules grows to a larger amount, and if they are created by different developers, it would be infeasible to work out this way. Some sort of packaging system and repository support is, IMO, necessary here.

0
Comment actions Permalink

My idea on "monolithic repository" works by putting all application modules into a single, say git, repository, managed by many solutions in one or more projects in the repository. Then every developer cloning the repository automatically gets all possible solutions and modules. This method has its own drawbacks though.

0
Comment actions Permalink

Let me clarify terminology first: in MPS a solution is a kind of module (other kinds being a language, a generator, or a devkit). So you can't define a module in a solution.

MPS doesn't support any interaction with remote package repositories from within the IDE.[*]

What my clients usually do is they create a Maven or Gradle build for their MPS project which downloads the dependencies from a remote Maven repository where they are stored in the zip format and unpacks them for use by the current project.

The MPS projects of my customers that I have experience with so far have only had a small amount of modules so this has not been a concern. Of course if you are looking at large-scale MPS deployment then it would make sense to invest in building a custom Gradle or Maven plugin to simplify the dependency management.

A while ago I have published a Gradle plugin that was going in this direction: https://github.com/specificlanguages/mps-gradle-plugin. Have a look at it for inspiration.

 

[*] Apart from the Settings -> Plugins tab. But the purpose of those plugins is to enhance the IDE itself, not to provide libraries for the code written in the IDE.

1

Please sign in to leave a comment.