Tutorial: Develop RT-Druid plugins

From ErikaWiki

Jump to: navigation, search

First of all, you need the RT-Druid code. To get it, please check it out from the Svn repository. Then you need an editor. There are two options:

  • use your preferred one
  • use Eclipse

This page contains a few hints in case you are going to use Eclipse.

Note that you need some Eclipse plugins to compile RT-Druid even if you compile it by hand,
i.e. not using Eclipse build environment.

We strongly suggest to use Eclipse environment to build and debug RT-Druid plugins.


Contents

Code structure

RT-Druid source code is organized in several Eclipse projects; most of them correspond to a feature or a plugin. These projects are organized in the repository in few categories:

  • Products: contains Eclipse projects related to the packaging of the RT-Druid distributions
  • Source: the source code of RT-Druid
    • Core: the main part
    • Analysis: plugins related to the schedulability analysis of a system
    • Oil: OIL language support
  • Testing: all plugins related to the test of RT-Druid code



Setting up Eclipse

What you need to develop RT-Druid plugins is:

Even if they are not required, you can install also plugins for versioning like subversive, or for bug reporting like mylyn.

Note: here you can find some instruction about how install the plugins using the Eclipse Update Manager.
Note: We suggest to use Eclipse 3.7 (Indigo). Today RT-Druid works with all versions of Eclipse since 3.4,
but future development may break this compatibility.

Setting Ant and output paths

In order to easily move RT-Druid plugins through various versions and installations of Eclipse, we use two variables ANT_HOME and MEM_OUTPUT_LOCATION. We can set both using the Eclipse preference window, opened through the Preferences command in the Window menu

Preferences location in the Eclipse menu
  • ANT_HOME points to the Ant plugin in the current installation of Eclipse
An example of ANT_HOME variable
  • MEM_OUTPUT_LOCATION is the place where store binary files generated during the Eclipse build. (Note that this path is not used during the building of the update site and other RT-Druid products). This allows to separate the source from the binary, with some useful effects like:
    • it is possible to put the output files in a ram-disk (to speed up compilation...)
    • you can compile the same code files with more than one version/instance of Eclipse at the same time
    • the source code directories are kept clean
An example of MEM_OUTPUT_LOCATION variable


Importing projects

To import RT-Druid projects into your Eclipse workspace, you have to select Import... from File menu

Import command

Then select "Existing projects into workspace"

Select import Existing projects

The window requires the path on your filesystem containing RT-Druid source projects (in this example, the path is E:\work\RT-Druid). If the path is correct you should see the list of the available RT-Druid projects, and you can select the ones to import in your workspace. The Copy project flag allows you to copy all the files in your workspace, otherwise Eclipse will read and write directly in the path you specified. Working set is useful to quickly select a group of projects.

Import Existing projects wizard

If you set "ant" and "output" paths, and if you have autobuild enabled (true by default), you should see Eclipse starting to compile all RT-Druid projects you just imported.


Import result
Personal tools