[xpand] reference to metamodel not understood by generator [message #495630] |
Thu, 05 November 2009 14:39 |
RJ Messages: 19 Registered: October 2009 Location: Eindhoven, The Netherland... |
Junior Member |
|
|
Hi,
I have created a metamodel, which resides in my workspace, and had nsUri "http://planner/1.0".
Now I want to generate code, so I made and xpand file and a workflow-file to run the xpand file:
<workflow>
<property name="model" value="planner/testmodel.planner"/>
<property name="src-gen" value="src-gen"/>
<!-- set up EMF for standalone execution -->
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<platformUri value=".."/>
</bean>
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.emf.mwe.utils.Reader">
<uri value="platform:/resource/${model}"/>
<modelSlot value="model"/>
</component>
<!-- check model -->
<component class="org.eclipse.xtend.check.CheckComponent">
<metaModel id="mm" class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel"/>
<checkFile value="metamodel::Checks"/>
<emfAllChildrenSlot value="model"/>
</component>
<!-- generate code -->
<component class="org.eclipse.xpand2.Generator">
<metaModel idRef="mm"/>
<expand value="template::Template::main FOR model"/>
<outlet path="${src-gen}"/>
</component>
</workflow>
The header of the "planner/testmodel.planner" model is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:planner="http://planner/1.0">
And I'm getting the following error:
SEVERE: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://planner/1.0' not found. (platform:/resource/planner/testmodel.planner, 3, 54)
Now if I manually change the "xmlns:planner" property of the model to "platform:/resource/my.planner.metamodel/model/planner.ecore ", which is the physical location of the metamodel, it does work. But since the models are generated and the code-generation is part of a chain, I don't want the manually edit the files every time.
So is there a way to let the generator know that http://planner/1.0 refers to the metamodel? I've tried listing the directory of the metamodel as a dependency, but that did not help...
thanks in advance,
RJ
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03351 seconds