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"
(→Known problems) |
(→Known problems) |
||
Line 49: | Line 49: | ||
Migration action recognizes *.xpt and *.ext files only. Content of these files will be updated and stored in a new template root. All the other files located in legacy template root will be just copied into the same relative directory below newly created template root. | Migration action recognizes *.xpt and *.ext files only. Content of these files will be updated and stored in a new template root. All the other files located in legacy template root will be just copied into the same relative directory below newly created template root. | ||
− | == Known | + | == Known limitations == |
+ | Here you can find a list of known limitations of Xtend->QVTO model query language migration with proposed solutions. If you find any other problems please file a bugzilla request to correct corresponding migration tool problem(s) or update this wiki page. | ||
=== QVTO Collections are always types === | === QVTO Collections are always types === |
Revision as of 14:14, 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 was designed to help in a migration of existing legacy Xtend-based templates 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 Repeat these steps for all template projects
- 2.6 Ensure all projects with migrated templates are compilable
- 2.7 Other resources located below template root
- 3 Known limitations
- 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.
Repeat these steps for all template projects
In case of independent project you can simply repeat these steps for all template projects. If you have cross-project dependencies then it is suggested to migrate most common project(s) first.
Example: If you have a project p1 with the templates using templates from another project p2 then you have to:
Content of p2/.xpand-root before the migration:
templates, /p2/templates
Ensure all projects with migrated templates are compilable
Currently (see GMF Xpand Migration howto#TODO) QVTO-based Xpand project builder has the same ID as legacy Xtend-based one. In other words, template project builder was modified to compile templates using QVTO-based query language. As a result all the existing projects containing legacy templates can not be compiled normally by this new builder unless they are migrated.
If you have an independent template project then you have to perform migration procedure (including .xpand-root file modification) and then invoke full build for this project to see the actual compilation problems.
In case of cross-project dependencies you have to migrate all template projects first and then perform full build for all the projects containing templates.
At the end all the migrated templates should be successfully compiled. If you still have some compilation errors then check GMF Xpand Migration howto#Known problems section of this document describing how to resolve specific situations which are not supported by a automated migration now.
Other resources located below template root
Migration action recognizes *.xpt and *.ext files only. Content of these files will be updated and stored in a new template root. All the other files located in legacy template root will be just copied into the same relative directory below newly created template root.
Known limitations
Here you can find a list of known limitations of Xtend->QVTO model query language migration with proposed solutions. If you find any other problems please file a bugzilla request to correct corresponding migration tool problem(s) or update this wiki page.