eclipseeclipse-rcptarget-platform

Best way to share a Target Platform for Eclipse RCP project


What is the best way to share a Target Platform?

E.g. together with the source code of some RCP project.

I can define a .target file and fill it with remote p2 sites and share this file. The problem here is first, those sites tend to be very slow and unreliable. From experience, resolving such a Target Platform fails from time to time.

A more reliable and faster (in terms of loading this Target Platform) approach is to define a local directory, that contains all plugins and features.

This directory can either be part of the source repository itself or I can provide a (fast and reliable) remote site from which I can download this target platform anytime.

The difficulty here is, how can I translate a list of p2 sites into a directory, that contains those plugins and features which are provided by the update site?

When I set a specific target platform from within Eclipse, where are those artifacts actually saved? I assume I could just copy this directory.


Solution

  • Despite the sometimes slow Eclipse p2 repositories and despite the crappy target platform editor, I still recommend using .target files. They are easy to share because they can be stored in the source code repository.

    While resolving a target platform, PDE caches bundles in the .metadata/.plugins/org.eclipse.pde.core/.bundle_pool directory of the workspace.

    Using .target files also allows you to use Tycho as a build tool. Note, however, that Tycho cannot read from local (i.e. file://) repositories.

    It is the most common and most accepted way of providing dependencies for RCP/plug-in development.

    To mitigate the unreliable performance of Eclipse p2 repositories you may want to mirror these and specify the mirrored sites in your target platform definition.

    There is also Target Platform Definition DSL and Generator that you might try as a drop-in replacement for if you are dissatisfied with the reliability of the the PDE target platform editor.