Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "GMF Xpand Migration howto"

(How to execute)
(Ensure existing templates pesent in the workspace)
Line 18: Line 18:
 
=== Download and install migration tool ===
 
=== Download and install migration tool ===
 
Detailed description of Migration tool distribution you can find above: [[GMF_Xpand_Migration_howto#Migration_Tool]].
 
Detailed description of Migration tool distribution you can find above: [[GMF_Xpand_Migration_howto#Migration_Tool]].
=== Ensure existing templates pesent in the workspace ===
+
=== 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. 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 see examples of valid .xpand-root files from [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/.xpand-root?revision=1.1&root=Modeling_Project&view=markup org.eclipse.gmf.codegen plug-in] and from [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/.xpand-root?revision=1.1&root=Modeling_Project&view=markup 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.
+
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 [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/.xpand-root?revision=1.1&root=Modeling_Project&view=markup org.eclipse.gmf.codegen plug-in] and from [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/.xpand-root?revision=1.1&root=Modeling_Project&view=markup 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.
  
 
== Known problems ==
 
== Known problems ==

Revision as of 08:31, 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.

Migration Tool

Migration tool consists of following plugins:

  • org.eclipse.gmf.xpand.migration
  • org.eclipse.gmf.xpand.qvtlibrary

    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.

    Known problems

    Additional References

  • OCL 2.0 specification on OMG web site: http://www.omg.org/spec/OCL/2.0/
  • QVT 1.0 specification on OMG web site: http://www.omg.org/spec/QVT/1.0/
  • M2M/Operational_QVT_Language_(QVTO)
  • Back to the top