Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [org.eclipse.emf.codegen.ecore] Model code generation templates in Xtend?
[org.eclipse.emf.codegen.ecore] Model code generation templates in Xtend? [message #1235530] Fri, 24 January 2014 15:45 Go to next message
Bertrand Quenin is currently offline Bertrand QueninFriend
Messages: 70
Registered: July 2009
Member
Hi,

I was looking at the source code of EMF looking for templates used for code generation from a GenModel and I ended up looking inside the "org.eclipse.emf.codegen.ecore" plugin source code.

There, I found Java and JET templates (I assume the former is generated from the latter) and I was wondering:

  • Am I looking at the right templates? i.e. are these templates the ones used when generating code using "Right click->Generated Model code"?
  • If so, is there by any chance an Xtend version of these templates available somewhere ?


What I'm looking for is to generate the same code as Eclipse would do but by using Xtend.

Thanks,
BQ.
Re: [org.eclipse.emf.codegen.ecore] Model code generation templates in Xtend? [message #1235543 is a reply to message #1235530] Fri, 24 January 2014 16:15 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 24-01-14 16:45, Bertrand Quenin wrote:
> Hi,
>
> I was looking at the source code of EMF looking for templates used for
> code generation from a GenModel and I ended up looking inside the
> "org.eclipse.emf.codegen.ecore" plugin source code.
>
> There, I found Java and JET templates (I assume the former is generated
> from the latter) and I was wondering:
>
> Am I looking at the right templates? i.e. are these templates the ones
> used when generating code using "Right click->Generated Model code"?
> If so, is there by any chance an Xtend version of these templates
> available somewhere ?
No, I don't think the EMF code generation ever moved beyond Xtend.
I made an attempt to move EMF to e4 generation, which at some point
would start to use Xtend, but that is really only the UI side of EMF.
see here: https://github.com/dzonekl/e4mf

What is it you are looking for to change in the templates?

>
> What I'm looking for is to generate the same code as Eclipse would do
> but by using Xtend.
>
> Thanks,
> BQ.
>
Re: [org.eclipse.emf.codegen.ecore] Model code generation templates in Xtend? [message #1235544 is a reply to message #1235543] Fri, 24 January 2014 16:16 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 24-01-14 17:15, Christophe Bouhier wrote:
> On 24-01-14 16:45, Bertrand Quenin wrote:
>> Hi,
>>
>> I was looking at the source code of EMF looking for templates used for
>> code generation from a GenModel and I ended up looking inside the
>> "org.eclipse.emf.codegen.ecore" plugin source code.
>>
>> There, I found Java and JET templates (I assume the former is generated
>> from the latter) and I was wondering:
>>
>> Am I looking at the right templates? i.e. are these templates the ones
>> used when generating code using "Right click->Generated Model code"?
>> If so, is there by any chance an Xtend version of these templates
>> available somewhere ?
> No, I don't think the EMF code generation ever moved beyond Xtend.

moved beyond JET that is....

> I made an attempt to move EMF to e4 generation, which at some point
> would start to use Xtend, but that is really only the UI side of EMF.
> see here: https://github.com/dzonekl/e4mf
>
> What is it you are looking for to change in the templates?
>
>>
>> What I'm looking for is to generate the same code as Eclipse would do
>> but by using Xtend.
>>
>> Thanks,
>> BQ.
>>
>
Re: [org.eclipse.emf.codegen.ecore] Model code generation templates in Xtend? [message #1235563 is a reply to message #1235543] Fri, 24 January 2014 17:16 Go to previous message
Bertrand Quenin is currently offline Bertrand QueninFriend
Messages: 70
Registered: July 2009
Member
Thanks for the info, I'm definitely gonna have a look at e4mf.

Why I'm looking for this? Because I want to have total control on how the code is generated.

Regards,
BQ.
Previous Topic:EMF Facet - adding additional Attributes
Next Topic:[EEF] How to Generate Multiple Tabs
Goto Forum:
  


Current Time: Fri Mar 05 08:42:34 GMT 2021

Powered by FUDForum. Page generated in 0.02054 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top