[Xpand/Xtend] : xtext extensions importation [message #1414451] |
Sun, 31 August 2014 10:38 |
|
Hi,
I write a xtend module where I import some xtend modules :
«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»
I've added in dependencies :
org.eclipse.xtext
and
org.eclipse.xtext.generator
plugins
But:
whereas all is fine for «EXTENSION org::eclipse::xtext::EcoreUtils
«EXTENSION org::eclipse::xtext::generator::Naming» raises an error :
Quote:Error while importing extension: Resource org::eclipse::xtext::generator::Naming
not found.
What is destabilizing : at the same time, I able to import a java class of the same package, org.eclipse.xtext.generator.
What's the ""fuck"" ?
Someone can help me ?
Thanks a lot by advance
[Updated on: Sun, 31 August 2014 11:05] Report message to a moderator
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1414464 is a reply to message #1414451] |
Sun, 31 August 2014 11:24 |
|
Hi,
i have no idea on that
xtend 1 question should be asked in the m2t forum.
are you writing a own fragment or what is that reason that you are doing this?
- are you sure the path for the .ext file is <somesourcefolder>/org/eclipse/xtext/generator/Naming.ext and the project has xtend/xpand nature?
- does the generator bundle export that package?
- happens the error in the editor or running the code.
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1414610 is a reply to message #1414464] |
Sun, 31 August 2014 22:26 |
|
Running code conducts to this :
2964 INFO CompositeComponent - Generator(generator): generating 'Root::Root FOR model' => src-gen
3249 ERROR AbstractExpressionsUsingWorkflowComponent - Error in Component generator of type org.eclipse.xpand2.Generator:
EvaluationException : No Definition 'Root::Root for List' found!
[23,27] on line 1 'EXPAND Root::Root FOR model'
Does it mean my xpand code is valid because this message occurs whether the faulty extensions code is present or not ?
|
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1414737 is a reply to message #1414725] |
Mon, 01 September 2014 07:26 |
|
This is what astonishes me because it is not supposed to be a List.
Here is the workflow that raises this error:
<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
</bean>
<component id="dirCleaner"
class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="src-gen"/>
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.xtext.mwe.UriBasedReader">
<uri value="platform:/resource/my.generator.project/data/Xtext.xtext" />
<register class='org.eclipse.xtext.XtextStandaloneSetup'/>
<load slot='model'/>
</component>
<component id="generator" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
<expand value="Root::Root FOR model"/>
<fileEncoding value="ISO-8859-1"/>
<outlet path="src-gen">
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier"/>
</outlet>
</component>
</workflow>
And this is the template called:
«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»
«IMPORT xtext»
«DEFINE grammar FOR Grammar»
«ENDDEFINE»
|
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1414758 is a reply to message #1414739] |
Mon, 01 September 2014 08:38 |
|
Yep ! You are great.
I received a more obscur message now :
Workflow interrupted. Reason: No Definition 'Root::Root for org::eclipse::xtext::impl::GrammarImpl' found!
I can't understand because the workflow worked pretty well with the UML tutorial example.
Let me guess ... org.eclipse.xtext.impl doens't need to be exported at least ?!
|
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1414782 is a reply to message #1414763] |
Mon, 01 September 2014 09:37 |
|
My source codes remain the same as presented in this topic
whereas my configuration is the following :
runRoot.mwe is modified as you've suggested :
<?xml version="1.0" encoding="ISO-8859-1"?>
<workflow>
<bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
<platformUri value=".."/>
</bean>
<component id="dirCleaner"
class="org.eclipse.emf.mwe.utils.DirectoryCleaner"
directory="src-gen"/>
<!-- load model and store it in slot 'model' -->
<component class="org.eclipse.xtext.mwe.UriBasedReader">
<uri value="platform:/resource/my.generator.project/data/Xtext.xtext" />
<register class='org.eclipse.xtext.XtextStandaloneSetup'/>
<load slot='model'/>
</component>
<component id="generator" class="org.eclipse.xpand2.Generator" skipOnErrors="true">
<expand value="Root::Root FOREACH model"/>
<fileEncoding value="ISO-8859-1"/>
<outlet path="src-gen">
<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier"/>
</outlet>
</component>
</workflow>
[Updated on: Mon, 01 September 2014 09:43] Report message to a moderator
|
|
|
|
Re: [Xpand/Xtend] : xtext extensions importation [message #1419593 is a reply to message #1414785] |
Mon, 08 September 2014 21:17 |
|
Indeed, I guess you couldn't see my screenshot (with template code, config, console messages, ...). The actual edit is the template, Root.xpt :
Here is what you can see on screenshot above :
«EXTENSION org::eclipse::xtext::generator::parser::antlr::AntlrGrammar»
«EXTENSION org::eclipse::xtext::generator::parser::antlr::Parser»
«EXTENSION org::eclipse::xtext::EcoreUtils»
«EXTENSION org::eclipse::xtext::generator::Naming»
«IMPORT xtext»
«DEFINE grammar FOR Grammar»
«ENDDEFINE»
[Updated on: Mon, 08 September 2014 21:23] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03267 seconds