Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Texo/Integrate code generation in a build

Introduction

Texo code generation can be integrated quite easily within your build process. Texo needs Eclipse and a workspace to generate code because Texo uses Eclipse for code formatting and import resolving. This wiki page discusses how Texo can be run headless directly or using ant.

Environment

Eclipse

Texo needs Eclipse and a workspace to generate code. The Eclipse version needs the Texo plugins to be installed. To setup Eclipse choose one of the version from the Eclipse downloads page, for example the 'Eclipse IDE for Java Developers' can be used (it is the smallest). Choose the version which can run on the platform on which your build is being run.

Then next install the Texo plugins within the downloaded Eclipse version. This can be done through the update manager using update site or by downloading the plugins directly from this site and placing the plugins in the dropins directory.

Now you have an Eclipse ready to be used. Place the Eclipse version somewhere on your build server and keep track of the directory where it is placed. You can alternatively also zip/tar.gz it and unzip it during the build or other solutions. As long as during the build this Eclipse installation is available by your build script.

Workspace and Java Project

Texo also needs a workspace and a java project for the code generation. But these can also be created automatically by Texo during the code generation. Creating them up-fron gives the following advantages:

  • you have better control on the code formatting and import resolving used: if you prepare a workspace with a java project before you can define these formatting rules within that java project.
  • texo code generation settings: within the java project you can also set Texo related settings such as the output folder, the template directory for template overriding or ORM options.

But again: Texo can and will also generate the workspace and java project for you if you don't specify one.

Code generation: java

Code generation: ant

Org.eclipse.emf.texo.generate.code.png

Copyright © Eclipse Foundation, Inc. All Rights Reserved.