Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "GMF Xpand Migration howto"
(→Migration of complex template projects) |
(→Migration of complex template projects) |
||
Line 38: | Line 38: | ||
templates, /p2/templates | templates, /p2/templates | ||
</pre> | </pre> | ||
+ | |||
+ | === Ensure all projects with migrated templates are compilable === | ||
== Known problems == | == Known problems == |
Revision as of 12:25, 23 December 2008
One of the most noticeable changes developed during GMF 2.2 M4 cycle was integration of QVTO-based model query language with the Xpand template language used throughout GMF. This document is important for those who used custom templates during GMF-based diagram(s) code generation and designed to help in a migration of existing custom template to new QVTO-based queries.
Contents
- 1 Migration Tool
- 2 How to execute
- 2.1 Download and install migration tool
- 2.2 Ensure existing templates present in the workspace and can be compiled
- 2.3 Execute migration action
- 2.4 Modify .xpand-root to point to new QVTO-based templates
- 2.5 Migration of complex template projects
- 2.6 Ensure all projects with migrated templates are compilable
- 3 Known problems
- 4 TODO
- 5 Additional References
Migration Tool
Migration tool consists of following plugins:
and can be downloaded as a part of GMF 2.2M4 or later. Source code is available from GMF Development Guidelines#CVS.
org.eclipse.gmf.xpand.migration
This plug-in contains slightly modified source code of legacy GMF Xpand engine together with migration code including UI contribution – probably this package should be reworked later to separate all three logical parts from each other. This plug-in should be installed into the platform to let migration action(s) working. This plug-in is responsible for the GMF Xpand dialect migration, but with minor modifications can be used to migrate any Xtend language-based queries to QVTO-based.
org.eclipse.gmf.xpand.qvtlibrary
QVTO and Xtend languages are very similar, but nevertheless some particular Xtend constructions cannot be simply copied using QVTO – this language always has alternative constructions, but the semantic of QVTO construction can be different from the original Xtend query. In such cases migration code will produce .xpt/.qvto files referencing native libraries implementing particular Xtend language functions. All these native libraries are collected in org.eclipse.gmf.xpand.qvtlibrary plug-in. This plug-in should be installed into the platform to make .xpt/.qvto files produced by the migration plug-in compilable/executable.
How to execute
Download and install migration tool
Detailed description of Migration tool distribution you can find above: GMF_Xpand_Migration_howto#Migration_Tool.
Ensure existing templates present in the workspace and can be compiled
Ensure Eclipse project with existing (legacy) Xtend-based templates is available in current workspace and can be properly compiled by legacy Xpand builder. To make existing templates compilable you have to create valid .xpand-root file in the root of the project with templates. This file was used in past by Xpand project builder to recognize local folders with templates (template roots) and point to the external template roots located in other projects/plugins. This dependency was necessary to resolve original templates called/aspected by template files from this template root. Here you can find examples of valid .xpand-root files from org.eclipse.gmf.codegen plug-in and from org.eclipse.gmf.codegen.lite plug-in. Format of this file was not changed during migration, so new QVTO-based Xpand uses the same style of .xpand-root file.
Execute migration action
Invoke popup menu for the project in workspace containing legacy templates and execute Migrate to new QVTO-based xpand popup menu action. You can expect following results of this action execution:
Modify .xpand-root to point to new QVTO-based templates
Now you have to open .xpand-root file in an editor and modify it to point to the newly created template roots with QVTO-based templates instead of template roots with legacy templates. Usually this means you have to add .migrated extension to each of .xpand-root file entries.
Migration of complex template projects
If you have a project p1 with the templates using templates from another project p2 then you have to:
templates, /p2/templates