Summary: | Source eCore file is read from plugin instead of workspace | ||
---|---|---|---|
Product: | [Modeling] Acceleo | Reporter: | Eric Lépicier <eric.lepicier> |
Component: | Core | Assignee: | Project Inbox <accceleo-inbox> |
Status: | NEW --- | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | laurent.goubet |
Version: | 3.5.0 | Keywords: | triaged |
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Whiteboard: |
Description
Eric Lépicier
2017-08-22 08:30:32 EDT
We advise not to have the metamodel in the same workspace as it causes adverse effects such as what you're experiencing. These problems originate from the pre-luna versions when Acceleo generations could be started from the same workspace as they were developped in, so there could be ways to avoid these limitations now... Instead of overriding the whole initialize method, I suggest you override the "createURIConverter" method to return your own, or null. Laurent, I understand the advice, but in my case, the ecore metamodel is the source model of my M2T transformation ... And I can't remove it from the platform when getting it in the workspace. As I said, it was my first approach to override the createURIConverter method, giving it a null result. The problem is then that this URIConverter is used both for source model and module loading. When null, the module loading fails. I would suggest you to use two different URIConverter, one for the source model which could be overridden in a simple way by user code (createURIConverter method), and another specific one to keep mastering the .emtl loading. That's what I implemented : commenting the modelResourceSet.setURIConverter(uriConverter) line is like letting it null), the pity is to be forced to copy the whole complicated initialize method. It doesn't cost much to add a new protected "ceate*URIConverter" method that users can override but that will by default delegate to the existing "createURIConverter" one I guess. Can keep this in mind for the next version. That would be nice, keeping compatibility and offering a clean way to customize ;-) |