[xtext] "EPackage is used twice" or How to import several packages of the same ecore model [message #536933] |
Mon, 31 May 2010 10:32  |
Eclipse User |
|
|
|
Originally posted by: kuehnlenz.informatik.hu-berlin.de
Hi,
My existing ecore model has several packages:
- root_package
-- package_A
-- package_B
-- package_C
and within package A classes from package B and C are referenced.
Now I used the project creation wizard "Xtext Project From Existing
Ecore Models" with the root_package as default package.
The generated xtext file contains now three imports:
import "platform:/resource/testProject/test.ecore" as package_A
import "platform:/resource/testProject/test.ecore" as package_B
import "platform:/resource/testProject/test.ecore" as package_C
But there are error messages on that import statements:
"EPackage [...] is used twice."
What I have to do in order to import/use several packages of the same
ecore model?
Thanks in advance,
Frank
|
|
|
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #537035 is a reply to message #536933] |
Tue, 01 June 2010 02:24  |
Eclipse User |
|
|
|
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)
Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.
If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.
>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C
That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:
platform:/resource/testProject/test.ecore#//package_A
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
Re: [xtext] "EPackage is used twice" or How to import several packages of the same ecore m [message #622960 is a reply to message #536933] |
Tue, 01 June 2010 02:24  |
Eclipse User |
|
|
|
(replying to eclipse.modeling.tmf, which is where Xtext is discussed)
Frank Kuehnlenz schrieb:
> Hi,
>
> My existing ecore model has several packages:
> - root_package
> -- package_A
> -- package_B
> -- package_C
>
> and within package A classes from package B and C are referenced.
>
> Now I used the project creation wizard "Xtext Project From Existing
> Ecore Models" with the root_package as default package.
If you can split them up, i.e. one file per EPackage, I strongly suggest
to do so. Nested packages tend to complicate things.
>
> The generated xtext file contains now three imports:
>
> import "platform:/resource/testProject/test.ecore" as package_A
> import "platform:/resource/testProject/test.ecore" as package_B
> import "platform:/resource/testProject/test.ecore" as package_C
That's a bug in the wizard (please file a bug report).
You need to add the fragment part to the URIs. They should looke like
this:
platform:/resource/testProject/test.ecore#//package_A
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
Powered by
FUDForum. Page generated in 0.03870 seconds