I've got a project that uses an xcore model as a starting point and am having problems with the the .ecore source that gets built from the xcore one.
My xcore file sets the model directory to src, rather than src-gen, to allow me to alter some of the generated code.
If I delete the model.ecore source and do a clean build then the model.ecore source that gets generated looks fine.
If I then do another clean build, without first removing model.ecore, this results in a different version of the source which produces a "resource does not exist" error.
When I look at the modified ecore text I see the following:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model" nsURI="com.test.model" nsPrefix="model">
<eClassifiers xsi:type="ecore:EClass" name="Model" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="DatatypesModel" eSuperTypes="com.test.model#//Model">
<eStructuralFeatures xsi:type="ecore:EReference" name="domains" upperBound="-1"
eType="ecore:EClass com.test.model#//BaseDomain" containment="true" resolveProxies="false"/>
</eClassifiers>
...
And here's what the original version looks like:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model" nsURI="com.test.model" nsPrefix="model">
<eClassifiers xsi:type="ecore:EClass" name="Model" abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="DatatypesModel" eSuperTypes="#//Model">
<eStructuralFeatures xsi:type="ecore:EReference" name="domains" upperBound="-1"
eType="#//BaseDomain" containment="true" resolveProxies="false"/>
</eClassifiers>
...
So the broken version has replaced local links with global ones, as you can see in the eType value. And this results in the ecore editor complaining it can't find the model resource.
Any idea why this might be happening?
Thanks
Kevin