Operational QVT Ant tasks let you launch QVTO transformations from the Ant script. These tasks can be run either from the Eclipse user interface or the command line.
modeltype ECORE uses 'http://www.eclipse.org/emf/2002/Ecore'; transformation Transf(inout m1 : ECORE, out m2 : ECORE);in assumption that it is stored in workspace in project "qvto" under "transforms" folder, can be called from Ant script as follows
<project name="project" default="default" xmlns:qvto="http://www.eclipse.org/qvt/1.0.0/Operational"> <target name="default"> <qvto:transformation uri="platform:/resource/qvto/transforms/Transf.qvto" > <inout uri="platform:/resource/qvto/transforms/in.ecore" outuri="platform:/resource/qvto/transforms/out_in.ecore" /> <out uri="platform:/resource/qvto/transforms/test.ecore#//cls"> <feature name="eAnnotations" clearcontents="true" /> </out> <trace uri="platform:/resource/qvto/transforms/Transformation.qvtotrace" /> </qvto:transformation> </target> </project>
Ant task used to run QVTO transformation is http://www.eclipse.org/qvt/1.0.0/Operational:transformation
.
Nested element and attribute definitions follows:
<Tag> / "Attribute" | Description |
<transformation> | References QVTO transformation task. |
"uri" | URI of the transformation file to be executed. |
<in> | References corresponding (in order) [in] transformation parameter. |
"uri" | URI of the [in] transformation parameter. |
<inout> | References corresponding (in order) [inout] transformation parameter. |
"uri" | URI of the [inout] transformation parameter passed as input. If "outuri" attribute is ommited then that URI is used to store output as well. |
"outuri" | URI for storing modified [inout] transformation parameter |
<out> | References corresponding (in order) [out] transformation parameter. |
"uri" | URI for storing [out] transformation parameter |
<feature> | References target structural feature (related to [out] transformation parameter URI) to save the result to. |
"name" | Name the target structural feature to save the result to. |
"clearcontents" | Specifies whether you want to clear contents of the target feature before writing the result. |
<trace> | References trace instance that is created upon transformation execution. If this tag is omitted, trace is not saved. |
"uri" | URI for storing trace file. |
All URIs used in transformation task (transformation URI, transformation's parameter URI, trace URI) are resolved due to the following rules:
In a command shell, run a command similar to the following one:
java -Xms128m -Xmx1024m -XX:MaxPermSize=256m -jar ./plugins/org.eclipse.equinox.launcher_<version>.jar -data <WORKSPACE_PATH> -nosplash -consolelog -application org.eclipse.ant.core.antRunner -f <ANTSCRIPT>where <WORKSPACE_PATH> is the path to your workspace and <ANTSCRIPT> is the path to your Ant script file.