Automating EMF Tasks – Codegeneration

In order to execute the task of code generation of an EMF model, an ant task is quite handy to do this. Here is an example for this:

<exec executable="${eclipse.exe}">
	<arg value="-noSplash" />
	<arg value="-data ${workspace_location}" />
	<arg value="-model" />
	<arg value="-edit" />
	<arg value="-editor" />
	<arg value="-tests" />
	<arg value="-application" />
	<arg value="org.eclipse.emf.codegen.ecore.Generator" />
	<arg value="${genmodel}" />

You can omit parameters like -edit if you do not need these parts.

Currently, I try to find an automation of the following tasks:

  • Clean the code generation (this can also be done using a simple delete command on the filesystem)
  • Create a genmodel from an ecore model
  • Reload a genmodel by an ecore model
  • Start an eclipse instance with the created plugins in its runtime