Search code examples
javaeclipsecode-generationxtextxtend

xtext generator how to prevent file override


How do I prevent Xtext generator from overriding custom modification I'm using the method doGenerate(Resource resource, IFileSystemAccess fsa) but each time the file gets overridden, I've tried @Generated NOT but this didn't work. thank you


Solution

  • the generator does not use JMerge

    you can change the OutputConfiguration through IOutputConfigurationProvider to set the property overrideExistingResourcesto false (for the default output configuration)

    never the less you should consider to adapt the generation gap pattern anyway.