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: 7
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: 7
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 message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
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

Previous Topic:How to generate/modify c code from XML?
Next Topic:Generation an XMI file to java file
Goto Forum:
  


Current Time: Fri Nov 28 03:29:13 GMT 2014

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

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