eclipse / epsilon

Epsilon is a family of Java-based scripting languages for automating common model-based software engineering tasks, such as code generation, model-to-model transformation and model validation, that work out of the box with EMF (including Xtext and Sirius), UML (including Cameo/MagicDraw), Simulink, XML and other types of models.
https://eclipse.org/epsilon
Eclipse Public License 2.0
66 stars 10 forks source link

Circular references in Flexmi #3

Closed kolovos closed 1 year ago

kolovos commented 1 year ago

The following Flexmi models m1.flexmi and m2.flexmi

<?nsuri http://www.eclipse.org/emf/2002/Ecore?>
<?import m2.flexmi?>
<class name="C1" supertypes="C2"/>
<?nsuri http://www.eclipse.org/emf/2002/Ecore?>
<?import m1.flexmi?>
<class name="C2" supertypes="C1"/>

that refer to each other don't resolve references correctly and as a result the following ANT build file

<project default="main">
  <target name="main">
    <epsilon.emf.loadModel name="M1" modelfile="m1.flexmi" metamodeluri="http://www.eclipse.org/emf/2002/Ecore" read="true" store="false"/>
    <epsilon.emf.loadModel name="M2" modelfile="m2.flexmi" metamodeluri="http://www.eclipse.org/emf/2002/Ecore" read="true" store="false"/>

    <epsilon.eol>
      M2!EClass.all.first().eSuperTypes.name.println();

      <model ref="M1"/>
      <model ref="M2"/>
    </epsilon.eol>
  </target>
</project>

prints Sequence{} instead of Sequence{C1}.

kolovos commented 1 year ago

Fixed in https://github.com/eclipse/epsilon/commit/26cde22481b14aefcf6a9336e0144317ed769b50.