| [beginners] [Acceleo] User code blocks with @generated do not work / target file is no longer merged [message #1823694] |
Tue, 31 March 2020 05:24  |
Eclipse User |
|
|
|
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]
|
|
|
|
Powered by
FUDForum. Page generated in 0.04063 seconds