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

Difference between revisions of "Linux Tools Project/LTTng Eclipse Plug-in Development Environment Setup"

(Import LTTng projects into the workspace: Updated for EGit)
(Import LTTng projects into the workspace: Remove PDE perspective)
Line 64: Line 64:
 
* Disable all org.eclipse.linuxtools.lttng.* projects (keep the *.ctf*, *.tmf* and *.lttng2* ones)
 
* Disable all org.eclipse.linuxtools.lttng.* projects (keep the *.ctf*, *.tmf* and *.lttng2* ones)
 
* Click Finish
 
* Click Finish
* Select "Window -> Open Perspective -> Other... -> Plug-in Development"
 
  
 
= Define an API baseline =
 
= Define an API baseline =

Revision as of 16:32, 25 September 2012

This page describes how to setup LTTng Eclipse Plug-in development environment.

Get the Eclipse SDK

Under eclipse.org downloads, select the Eclipse Classic archive. You can start with any Eclipse pre-package, but make sure you have the Eclipse Plug-in Development Environment feature installed.

Uncompress and start Eclipse. Example for Linux:

$ tar xzvf eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz
$ cd eclipse
$ ./eclipse

Install dependencies

Two dependencies are required: Remote System Explorer (RSE) and ANTLR. Here is how to install them. Note that RSE is in the project named Target Management on the Eclipse website.

  • RSE
    • Select "Help -> Install New Software..."
    • Select the current Eclipse release repository (e.g. Juno)
    • Select "General Purpose Tools -> Remote System Explorer End-User Runtime"
    • Install the package. It's not necessary to restart Eclipse at this point.
  • ANTLR
    • Select "Help -> Install New Software..." again
    • Click on "Available Software Sites"
    • Search for the Orbit repository. If it is not present in the list, add the following URL manually:
    • Click OK, then select the Orbit repository in the drop-down list.
    • Select "All Orbit Bundles" -> "ANTLR Runtime"
    • Install the package.
    • Restart Eclipse.

Get the source code for org.eclipse.linuxtools

Use the EGit client to clone the source repository in your workspace.

  • Select "Help -> Install New Software..."
  • Select the current Eclipse release repository (e.g. Juno)
  • Select "Collaboration -> Eclipse EGit"
  • Install the package.
  • Restart Eclipse
  • Select "Window -> Open Perspective -> Other... -> Git Repository Exploring"
  • In Git Repositories view toolbar, select "Clone a Git Repository..."
  • Type the following in "Location -> URI:":
  • Click Next
  • Click Next
  • Click Finish

Import LTTng projects into the workspace

Only projects related to LTTng 2.0 should be imported. For legacy LTTng, a TCF dependency is also required. To avoid this dependency and because the legacy LTTng will soon be deprecated, the procedure is limited to LTTng 2.0.

  • Select "File -> Import..."
  • Select "Git -> Projects from Git"
  • Select "Local"
  • Select the org.eclipse.linuxtools repository
  • Select the "lttng" directory under "Working Directory"
  • Click Next
  • Disable all org.eclipse.linuxtools.lttng.* projects (keep the *.ctf*, *.tmf* and *.lttng2* ones)
  • Click Finish

Define an API baseline

Since Linux Tools is now out of incubation, all API changes have to be tracked and marked with the proper @since annotations. The Eclipse API tool works by comparing the contents of the current workspace with a clean, separate installation of Eclipse in another directory (the "baseline").

If you will only be using this setup to run the latest git code, you can decide to ignore these errors by performing these steps:

  • Select "Window -> Preferences -> Plug-in Development -> API Baselines"
  • Under "Options -> Missing API baseline:" select "Ignore"
  • Click "OK"


However, if you intend of hacking at the code and contributing patches, then you are strongly encouraged to setup a baseline installation correctly:

Download the baseline install

  • Go to http://eclipse.org/downloads and download a copy of the Eclipse IDE for C/C++ Developers, if you don't already have one.
  • Extract it in a directory somewhere, separate from your normal Eclipse installation. We will call this new installation the baseline.

Update the baseline

The baseline needs to be updated with the latest version of Linux Tools. Intermediate releases might not be part of the base Eclipse install, so they have to be downloaded from the update site.

  • Run your baseline installation of Eclipse (cd to its directory and run ./eclipse).
  • Dismiss the splash screen and go to "Help -> Install New Software".
  • In the new window, click on the Available Software Sites link at the top.
  • In the following window, check the box next to the Linux Tools repository. If it's not present, you can add it, the URL is:
http://download.eclipse.org/linuxtools/update
  • Click OK until you go back to the first window, then on the drop-down menu, select --All Available Sites--.
  • In the list, open the Linux Tools subtree, and check all the LTTng * features.
  • Click Next, Next, Finish. The new versions of the plugins will be downloaded and installed.
  • Eclipse will offer to restart at this point. It might be a good idea to restart and make sure that the correct versions are installed.

Once you are done, close the baseline Eclipse. You should never have to run this installation, other than to update it.

Set up your regular Eclipse to use the baseline

  • In your regular Eclipse install, go to "Window -> Preferences -> Plug-in Development -> API Baselines".
  • Click on "Add Baseline..."
  • In the new window click "Browse...", and point it to the directory of the baseline Eclipse install you set up earlier.
  • Give your baseline a name, then click "Finish".

Once that is done, your workspace will be rebuilt and the API changes will now be tracked. Any new method or class will have to be annotated with "@since n", where n is the major.minor version number found in the plugin's MANIFEST.MF file.

Run the plugins

To run the code, right-click one of the imported plugins (for example, the o.e.l.tmf.core one) and select "Run As..." -> "Eclipse Application". This will start a nested Eclipse with the plugins loaded.

Back to the top