Skip to content

Instantly share code, notes, and snippets.

@hwellmann
Last active April 17, 2018 05:43
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hwellmann/6044835 to your computer and use it in GitHub Desktop.
Save hwellmann/6044835 to your computer and use it in GitHub Desktop.
Integrating EMF code generation from an Ecore model into a Tycho build. Sources: my.ecore, my.genmodel, plugin.xml, META-INF/MANIFEST.MF. build.properties Generated Java sources end up in target/generated-sources/emf/src. This directory is included in build.properties as an additional source folder.
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-eclipserun-plugin</artifactId>
<!-- tested with 0.18 -->
<version>${tycho.version}</version>
<configuration>
<!-- linebreaks not permitted in this arg line -->
<appArgLine>-data target/workspace -application org.eclipse.emf.codegen.ecore.Generator -projects ${basedir} -model ${basedir}/model/my.genmodel target/generated-sources/emf</appArgLine>
<dependencies>
<dependency>
<artifactId>org.eclipse.emf.codegen.ecore</artifactId>
<type>eclipse-plugin</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>kepler</id>
<layout>p2</layout>
<url>http://download.eclipse.org/releases/kepler</url>
</repository>
</repositories>
</configuration>
<executions>
<execution>
<goals>
<goal>eclipse-run</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
@renelink
Copy link

renelink commented Apr 17, 2018

Use CDATA to prevent formatters from breaking the line

 <appArgLine><![CDATA[-data target/workspace -application org.eclipse.emf.codegen.ecore.Generator -projects ${basedir} -model ${basedir}/model/my.genmodel target/generated-sources/emf]]></appArgLine>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment