This tutorial aims to show how to embedd kermeta code in an Eclipse plugin. It also shows how to add some java code that is able to initialize and call the kermeta code in Eclipse context.
Due to the requirement of OSGI deployment used by eclipse. The simple packaging strategy used in the previous chapter isn't enough. Some special care is required while packaging the code.
TODO
This tutorial will detail two scenarii:
the Kermeta code must be exposed to and used by several plugins
the Kermeta code is used by a single plugin and can be privatly used by it
Kermeta plugin needing to be exposed to several plugins
Create a new Kermeta project
Configure the project and a pom.xml that is able to take into account both Kermeta code and some java code that is able to generate an OSGI compatible jar file
The current recommanded way is to use maven-bundle-plugin.
Add some java code that initialize the kermeta code and expose some operations of the kermeta code as a simplified API
Add some java code that redirect kermeta StdIO messages to a dedicated eclipse console
Deploy and execute the plugins in an eclipse runtime workbench
Currently, the recommanded way to deploy the plugins is to use the OSGI provisionner
tips about how debugging
The tutorial also presents an alternative packaging that ease eclipse UI debugging: the UI plugin directly embedds the kermeta jar
Kermeta code is used by a single plugin and is privatly used by it. The kermeta code is compiled using eclipse and the simple pom.xml
Create an eclipse plugin
Automate the copy of the jar produced from the kermeta project to an internal lib folder: with eclipse ant builder
configure the plugin to use the jar
update the dependencies according to the one computed from the kermeta jar
Deploy and execute the plugins in an eclipse runtime workbench with the classic eclipse approeches
Use of a tycho driven pom.xml to automate the build of such plugin (use copy-dependency to grab the kermeta jar as a precompile step)
Alternative, The tutorial also presents an alternative packaging that ease eclipse UI debugging: the UI plugin directly embedds the kermeta jar, the Kermeta code is fully compiled using maven
Kermeta code is used by a single plugin and is privatly used by it
Create an eclipse plugin
Automate the copy of the jar produced from the kermeta project to an internal lib folder: with eclipse ant builder
configure the plugin to use the jar
update the dependencies according to the one computed from the kermeta jar
Deploy and execute the plugins in an eclipse runtime workbench with the classic eclipse approeches
Use of a tycho driven pom.xml to automate the build of such plugin (use copy-dependency to grab the kermeta jar as a precompile step)