MWE2 code generation is different between Eclipse/Maven [message #1818221] |
Tue, 10 December 2019 12:23 |
Axel RICHARD Messages: 43 Registered: September 2010 Location: France |
Member |
|
|
Hello,
When I run my MWE2 workflow file from Eclipse, the generated code from my DSL contains "import" statements for each required concept of the metamodel.
For example, in my MyDSLSwitch.java class :
import my.dsl.A;
import my.dsl.B;
...
When I run my MWE2 workflow file from Maven/Tycho (thanks to https://www.eclipse.org/Xtext/documentation/350_continuous_integration.html#tycho-build), the generated code from my DSL contains only one "import" with a wildcard.
For example, in my MyDSLSwitch.java class :
The other problem is I have a concept named "Iterable" in my grammar.
When the code is generated from Eclipse then "Iterable" is always used in its qualified form "my.dsl.Iterable" to avoid ambiguities with "java.lang.Iterable"
For example, in my MyDSLSwitch.java class :
@Override
public my.dsl.Iterable createIterable()
{
IterableImpl iterable = new IterableImpl();
return iterable;
}
When the code is generated from Maven/Tycho, "Iterable" is not used in its qualified form and leads to compiling errors, because there is an ambiguity with "java.lang.Iterable".
For example, in my MyDSLSwitch.java class :
@Override
public Iterable createIterable()
{
IterableImpl iterable = new IterableImpl();
return iterable;
}
I don't understand why there is a difference in the generated code between Eclipse and Maven/Tycho.
Is there a solution to get the exact same code generation between Eclipse and Maven/Tycho ?
Axel Richard
Obeo
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04275 seconds