Skip to main content



      Home
Home » Modeling » EMF » [beginners] [Acceleo] User code blocks with @generated do not work / target file is no longer merged(User code blocks with @generated )
[beginners] [Acceleo] User code blocks with @generated do not work / target file is no longer merged [message #1823694] Tue, 31 March 2020 05:24 Go to next message
Eclipse UserFriend
Hello!

I installed Eclipse 2020 03 from the beginning. I installed the Acceleo. I created an EMF project and created a .ecore file. I can also generate them well with .genmodel. Then according to "Acceleo get started" I started an Acceleo project and built a generate.mtl file. As long as I work with [protected ('blockname')], the generated code is merged, the protected user code remains.

My problem: As soon as I use / ** @ generated */ Tag nothing is merged anymore, nothing is changed in the target file. Only when I remove the last @generated from my generated target file does it work again.

--- my simple test code ---

[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/emf/2002/Ecore')]


[template public generateElement(aClass : EClass)]
[comment @main/]
[file (
aClass.ePackage.nsPrefix.substituteAll('.', '/')
.concat('/')
.concat(aClass.name.concat('Delegate.java'))
, false)]

package [aClass.ePackage.nsPrefix/];


public class [aClass.name.toUpperFirst()/]Delegate {

[for (op: EOperation | aClass.eAllOperations) separator ('\n')]
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public int [op.name/]() {
// [op.name/]
return 0;
}
[/for]

}
[/file]
[/template]
Re: [beginners] [Acceleo] User code blocks with @generated do not work / target file is no longer me [message #1823896 is a reply to message #1823694] Fri, 03 April 2020 10:11 Go to previous message
Eclipse UserFriend
Hi

You need to use the M2T [1] newsgroup for Acceleo questions. However since I tend to be the only respondent and have never used @generated in Acceleo . I'm not sure how much help you will get.

I can only suggest you emulate a tutorial example that works and/or read the posts of others who have experienced and solved @generated pain.

Regards

Ed Willink

[1] https://www.eclipse.org/forums/index.php/f/24/
Previous Topic:How to specify composed key in a reference
Next Topic:Override IItemLabelProvider.getText() for all derived classes
Goto Forum:
  


Current Time: Fri Nov 07 23:41:16 EST 2025

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

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

Back to the top