Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] JMerge tags with standalone generator
[Acceleo] JMerge tags with standalone generator [message #953647] Mon, 22 October 2012 12:18 Go to next message
Vincent Aranega is currently offline Vincent AranegaFriend
Messages: 10
Registered: July 2009
Junior Member

Hello,

I'm trying to use "@generated" JMerge tags for a Java generator (running standalone). Unfortunately, even if the @generated annotation are well placed in the generated code, a second generation do not generate anything. Each manual modification performed in the source code between tagged methods is not overwritten. Actually, it seems that the code is no longer generated. This trouble appears with the generator launched standalone. When the generation is launched by an acceleo configuration, problem is gone, annotations work fine.
I take a look toward the DefaultStrategy strategy, but it seems to enable JMerge tag usage.

Is the problem coming from a missing generator argument?

Regards,

Vincent


Re: [Acceleo] JMerge tags with standalone generator [message #957382 is a reply to message #953647] Thu, 25 October 2012 07:24 Go to previous messageGo to next message
Vincent Aranega is currently offline Vincent AranegaFriend
Messages: 10
Registered: July 2009
Junior Member

After more source reading and execution tracing, I figure out that the two strategies which can be used whithout eclipse cannot manage JMerge tag by themselves (DefaultStrategy and PreviewStrategy). The only one which is able to manage JMerge tag is the AcceleoWorkspaceStrategy, but this strategy prevent Acceleo to be run outside eclipse.

Currently, the only solution I found to manage JMerge tag in an Acceleo transformation running standalone (and outside eclipse, I probably should tell that in my previous messsage) is to create a new Strategy extending the PreviewStrategy (or reproducing the PreviewStrategy) and a new FileWriter that use JMerge.

Is there any other solution?


Re: [Acceleo] JMerge tags with standalone generator [message #957472 is a reply to message #957382] Thu, 25 October 2012 08:47 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Vincent,

Acceleo disables JMerge when outside of Eclipse for two reasons :


  • Avoid the dependency towards org.eclipse.emf.codegen for standalone Acceleo applications
  • JMerge did not work standalone until recently (bug 308069). IIRC, this has been fixed for Juno (Ed Willink and/or Ed Merks might help here, did not re-read through the bug).


Since this is only possible for Juno and onwards, your solution is the only one that works : the default generation strategy of Acceleo does not allow (does not even call) JMerge when running standalone as Acceleo is compatible down to Eclipse 3.5 (Galileo). However, if you do create such a generation strategy, do not hesitate to raise a bug against Acceleo with it attached, we can add it to the codebase as a fourth "example" along with the Default, workspace and preview strategies.

Laurent Goubet
Obeo

[Updated on: Thu, 25 October 2012 08:49]

Report message to a moderator

Re: [Acceleo] JMerge tags with standalone generator [message #1760850 is a reply to message #957382] Wed, 03 May 2017 15:26 Go to previous messageGo to next message
KAMTA DOMINQUE is currently offline KAMTA DOMINQUEFriend
Messages: 1
Registered: May 2017
Junior Member
Hi Vincent ,

I have the same problem as you. Can you share your solution ?

Thank you for all.
Re: [Acceleo] JMerge tags with standalone generator [message #1766152 is a reply to message #1760850] Fri, 16 June 2017 13:57 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Dominique,

Vincent never provided us with the upgraded generation strategy that would call JMerge while in standalone, and it has not been worked on by the Acceleo team. Acceleo has now dropped all support for eclipse Luna and prior, so it should now be possible to include in the main code base if it is indeed a limitation that has been removed by now.

Please keep us informed if you do make progress on this.

Laurent Goubet
Obeo
Previous Topic:BPMN to DD-lotos using Acceleo
Next Topic:[Acceleo] Multi-model to text transformation
Goto Forum:
  


Current Time: Fri Apr 26 00:43:53 GMT 2024

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

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

Back to the top