Contribute code indirectly
If you would like to improve the MPS code, you can submit a patch by attaching it to are not an MPS contributor, you can contribute your code in two ways:
- A pull request to the MPS github repository (prefered)
- A git patch file
In either case branch-off your code from the master branch or from a specific release branch (e.g. 2028.3).
In ideal case attach the patch or a link to your pull request to the corresponding request in the JetBrains MPS YouTrack bug database. You can either file a new issue with the patch attached, or attach a patch to an issue submitted by another user. A developer will review your patch/pull request and, if it meets the quality criteria and fits with the rest of the code, you'll be notified about the acceptance of the patch. As it was already mentioned, patches having a unit-test attaches should be processed faster.
Contribute code directly
Become a contributor and contribute directly into the git repository. This will require some up-front ceremony to grant you the necessary permissions, but regular contributions then become easier.
How to work with the MPS sources
Although the main Git repository is located at JetBrains (see the the Accessing MPS Git Repository section section below), we keep a public mirror at at GitHub. The mirror is primarily meant to be an easy-to-use repository for external contributors. Here's a cookbook on how to contribute your idea to MPS through GitHub
Building MPS from Source
This section describes how you create a fork of the MPS github repository and open the MPS project in IntelliJ IDEA.
- The MPS miror repository is at https://github.com/JetBrains/MPS. Fork the jetbrains/MPS repository into your own space using GitHub UI (go to the MPS repo and press the fork button at the top. This will create a fork of the reposistory in your github space)
- Once you created your own private fork, clone it to your local machine: git clone email@example.com:<yourGitHubName>/MPS.git. Depending on your internet connection, this may take a long time, MPS is big
- It is preferrable to work in your own branch, so create a new branch to work in git checkout -b my_branch_name
- Download IntelliJ IDEA from the JetBrains website. Community edition will work just fine.
- Open the MPS project using IntelliJ IDEA. In the Open Project Dialg, the folder you cloned MPS into should have the "IDEA project" icon automatically; MPS uses the .idea sub-folder to hold IDEA project definition, so it recognizes the directory as an IDEA project.
- IDEA may prompt you with an error that complains that no JDK is set up for the project. In the dialog that pops open, please create a new JDK and assign it to the project. Only JDK 6 and JDK 8 are supported.
- Rebuild the project Menu -> Build -> Rebuild Project. You will need to be connected to the internet, since the process downloads several essential dependencies.
- Run the MPSLauncher run configuration to start MPS inside IDEA: Menu -> Run -> Run...
- Alternatively, start a debugger session with the MPSDebug run configuration to start MPS inside IDEA with the option to set breakpoints in IDEA and debug MPS code: Menu -> Run -> Debug...
- Once MPS starts up, open the MPS project by pointing the Open Project dialog to the root of the cloned project: Menu -> File -> Open Project...
- As soon as the project is open you should install a handy interoperability plugin into the IntelliJ IDEA instance that you are using for MPS development. Go to Menu -> Tools -> Install IntelliJ IDEA Plugin, point to the right IDEA installation and restart. This will enable joint compilation between MPS and IDEA.
Please follow the instructions in the project README.md file to clone and build the project.
Building MPS from Source on the command line
The project structure
Admittedly the over overall project structure is very difficult to see from the hierarchy of modules and packages in IDEA and MPS and you'll be having hard time understanding how the pieces fit together. We've collected a few guidelines to help you in many cases. For the rest, please get in touch with us directly or through the forum.