crossecore / crossecore-generator

Code generator for Java, C#, TypeScript and Swift
Apache License 2.0
12 stars 8 forks source link

Hard-coded paths in the UML2.ecore #37

Open arun-prakash-fokus opened 3 years ago

arun-prakash-fokus commented 3 years ago

There are hard-coded paths in the UML2.ecore file

For instance, in lines 27-30:

<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap">
          <eTypeArguments eClassifier="ecore:EDataType file:///C:/Users/Simon/Data/git2/crossecore/model/Ecore.ecore#//EJavaObject"/>
          <eTypeArguments eClassifier="ecore:EDataType file:///C:/Users/Simon/Data/git2/crossecore/model/Ecore.ecore#//EJavaObject"/>
</eGenericType>
schwichti commented 3 years ago

Thanks, I am aware of that. Generating working code from UML2.ecore won't work anyway, because there are some particularities about UML2.ecore that needs to be handled by the generator: e.g. https://github.com/crossecore/crossecore-generator/issues/10. There might be more particularities... PRs welcome.

arun-prakash-fokus commented 3 years ago

Thanks!! I will take a look.

btw, to solve the above mentioned validation errors, maybe its enough to load the Ecore.ecore and Types.ecore as platform resources.

image

This would at least remove those errors

schwichti commented 3 years ago

CrossEcore runs outside Eclipse which is why I discourage plugin or resource URLs. In order for the generator to support legacy Ecore models I have outlined an approach to resolve plugin and resource URLs semi-automatic: https://github.com/crossecore/crossecore-generator/issues/35. To summarize, the idea is the following: if the generator finds any plugin or resource URLs in the Ecore models, it creates a config file that maps the resource/plugin URL to (absolute) file URLs. The user has to fill in the (absolute) file URLs manually. For the subsequent run of the generator, the user can provide that config file and the generator automatically replaces the URLs internally.