After installing 2.0, the following should be done to migrate old code to new format:
Warning!!! It is not possible to revert migrated models back to old format!
Just execute Main Menu -> Tools -> Start Migration to MPS 2.0 and follow the instructions.
If you want full control on what MPS will do, you can use this way of performing migration. In the next part we'll consider all the refactorings separately.
Do the following:
- Main Menu -> Tools -> Migrations 2.0 -> Upgrade Persistence
- Main Menu -> Tools -> Migrations 2.0 -> Fix Module Dependencies
- Main Menu -> Tools -> Migrations 2.0 -> Migrate Stub Models
- Open logical view, right-click project, select "Optimize Imports"
- Main Menu -> Tools -> Scripts -> All Scripts..., check all scripts with type "Migration (MPS 2.0)", click "Run Checked"
- Go to Main Menu -> File -> Settings. Select Model Checker properties and uncheck all checkboxes except "Check for unresolved references" and press "Ok". Right-click project node in logical view and select "Check Project". The Model Checker tool will show you all the broken references you have. Correct them by hand.
- Right-click project, select "Rebuild Project"
- (Recommended, but not necessary) Restart MPS.
What the migration will do with my code?
Fix Module Dependencies
Migrate Stub Models
Model Checker and manual references resolution
- File -> Invalidate Caches and restart MPS
- To correct language and aspect dependencies on devkits
- execute tools-> internal -> Add Language Design Devkit To All Languages
- execute tools-> internal -> Add General Purpose Devkit to Language Models
- execute tools-> internal -> Remove Language Design Devkit from Models
- execute tools-> internal -> Remove BootstrapLanguages Devkit from Language Models
- execute tools-> internal -> Add Necessary ModuleDeps Everywhere
- To migrate to new stubs format (fix broken references to stub models)
- Tools-> Update Stub Refs-> Update Language Accessories Refs
- Tools-> Update Stub Refs-> Re-resolve Stub Refs
- right-click on your project -> optimize imports
- Most of the references will be fixed at the moment. But a small amount of them can be left unresolved (if threre were illegal model imports which MPS was not able to find in previous versions). So, find all broken references left and fix them manually by adding necessary module dependencies. You can use Model Checker tool to find all broken references (right-click on project -> check models)
- To convert attributes to the new format (usually in generators, quotations and patterns)
- Tools -> Scripts -> By Language -> jetbrains.mps.lang.core -> Convert Attributes
- Re-generate languages, then solutions
- If you have your own attribute descriptions (
AnnotationLinkDeclarationinstances) it will require manual migration for each attribute:
- Ensure attribute concept described in
target) is subconcept of one of
PropertyAttributedepending on the attribute
roleconcept property in attribute concept as attribute
sourceCardinalitywas * define
multipleconcept property in attribute concept
attributedconcept link from
- Perform actions from steps 1 and 2 for migrated attributes
- For simple attributes (when they are direct subconcepts of
BaseConcept) migration script is available
- Ensure attribute concept described in
- To make virtual packages (folders) visible again
- Tools -> Scripts -> By Language -> jetbrains.mps.lang.core -> Restore Virtual Packages
- To convert TabbedEditors and icons in plugin aspects
- Tools-> Scripts-> By Language -> jetbrains.mps.lang.plugin -> split tabbed editors
- Tools-> Scripts-> By Language -> jetbrains.mps.lang.plugin -> Update Icons
- To migrate to the new trace information generation
- Tools -> Scripts->By Language->jetbrains.mps.lang.plugin->Upgrade Trace Info Generation
- Execute Tools->Scripts->By Language-> jetbrains.mps.baseLanguage.closures-> remove wildcards from unbound params
- Execute Tools->Scripts->By Language-> jetbrains.mps.baseLanguage.runConfigurations -> Fix References To Deleted Run Models
- Regenerate (!!! use "Rebuild" action, not "Make")
- all project languages
- all project solutions (!!! after languages)