|Re: [Acceleo]I don't want to chang the timestamp when the content is not changed [message #870638 is a reply to message #870541]
||Wed, 09 May 2012 07:35
| Laurent Goubet
Registered: July 2009
The default generation strategy of Acceleo is to write on-the-fly, except for files with "@generated" tags which will be overriden when we know their full content (yet we pass these to EMF's JMerge... which by default creates a new file even if the content is identical IIRC).
You will need to change this default strategy to implement what you are trying to achieve. This can be done through the "getGenerationStrategy" of the generated java file beside your main template.
You need to use another strategy in order not to override files that would not change. By default, we provide one such implementation through the "WorkspaceAwareStrategy" ... but that only works within an Eclipse workspace. If you are generating files outside of Eclipse, you need to implement your own. The easiest for you is probably to look at the org.eclipse.acceleo.engine.generation.strategy.WorkspaceAwareStrategy file and start from there, removing the uses of eclipse's "IFile" implementations to instead use "java.io.File".
[edit : in fact, the WorkspaceAwareStrategy might also work outside of Eclipse, though untested, the code takes that possibility into account]
[Updated on: Wed, 09 May 2012 07:37]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01851 seconds