[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: add copyright information in EMF generated Java

Hi Liangzhao,

There are no options in EMF 2.2 that will do this directly. You'll need to use dynamic templates with a custom Header.javajetinc that includes your copyright information.

You can do this by importing the templates/Header.javajetinc file from the org.eclipse.emf.codegen.ecore plug-in into your own project. Then, in your GenModel, under Templates & Merge, enable "Dynamic Templates" and set "Template Directory" with a workspace path (for example, "/MyProject/templates"). That should cause it to pick up the Header.javajetinc file when you generate the code, compiling the resulting templates on the fly. So, you can add whatever copyright information you want to have there. You can also copy in and modify Header.jetinc, Header.propertiesjetinc and Header.xmljetinc if you're concerned about other, non-Java artifacts.

Note that none of these changes will be merged into existing artifacts, so if you've already generated code, you'll need to delete it before regenerating and, where you've made changes manually, merge in the new headers.

Cheers,
Dave


liangzhao zeng wrote:
Hi, Dave

thanks a lot for the info. However, I use the EMF 2.2 that come with the RSA 7.0. any suggestions? I notice that there are property about the templates&merge, but not sure how to use them.

Cheers,

Liangzhao