Generating code for packages that only contain other packages [message #1391795] |
Tue, 01 July 2014 12:21  |
Eclipse User |
|
|
|
Hello,
I am working on a ecore model that has a package structure similiar to this:
The package rootp contains no classes, only the two packages packA and packB. When generating code from this model, no EPackage is created for rootp, only for the packages packA and packB.
This can be fixed by adding a class to the package rootp, but shouldn't there be a generated EPackage for rootp anyway? Is there an option to allow generating code for the package rootp?
I have attached an EMF project for demonstration of the problem.
Thanks,
Matthias
|
|
|
Re: Generating code for packages that only contain other packages [message #1391842 is a reply to message #1391795] |
Tue, 01 July 2014 13:44   |
Eclipse User |
|
|
|
Matthias,
Nested packages are evil, and no, we generate nothing for an empty package:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=142856
Adding a "dummy" EDataType will force it to generate.
Is there is a compelling reason to have generated code that's not
capable of doing anything useful? It's hard to imagine...
On 01/07/2014 2:21 PM, Matthias Jurisch wrote:
> Hello,
>
> I am working on a ecore model that has a package structure similiar to this:
>
>
> rootp
> - packA
> - packB
>
>
> The package rootp contains no classes, only the two packages packA and packB. When generating code from this model, no EPackage is created for rootp, only for the packages packA and packB.
>
> This can be fixed by adding a class to the package rootp, but shouldn't there be a generated EPackage for rootp anyway? Is there an option to allow generating code for the package rootp?
>
> I have attached an EMF project for demonstration of the problem.
>
> Thanks,
> Matthias
>
|
|
|
Re: Generating code for packages that only contain other packages [message #1391897 is a reply to message #1391842] |
Tue, 01 July 2014 15:15   |
Eclipse User |
|
|
|
Hello Ed,
thanks for your reply. I need the generated code only for registering the rootp package for model transformation with qvt operational. The problem I have here is that the package structure is different when using dynamic and static ecore, since when using static ecore the "empty" packages do not exist. So when I try to transform models created with static ecore the transformation does not compile.
Greetings, Matthias
|
|
|
Re: Generating code for packages that only contain other packages [message #1391968 is a reply to message #1391897] |
Tue, 01 July 2014 17:27  |
Eclipse User |
|
|
|
Matthias,
You're best to avoid subpackages entirely and if you can't avoid that, a
dummy EDataType will do the trick.
On 01/07/2014 5:15 PM, Matthias Jurisch wrote:
> Hello Ed,
>
> thanks for your reply. I need the generated code only for registering
> the rootp package for model transformation with qvt operational. The
> problem I have here is that the package structure is different when
> using dynamic and static ecore, since when using static ecore the
> "empty" packages do not exist. So when I try to transform models
> created with static ecore the transformation does not compile.
> Greetings, Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.03711 seconds