Eclipse and PDE builds

PDE builds 
I have been working with PDE builds for quite some time now.And to keep things short I will not get into much details of the whole build system. The whole build system is awesome and takes a lot of headache from the developers point of view by auto generating build files for all feature plugins. In short

“The goal of PDE Build is to facilitate the automation of plug-in build processes. Essentially, PDE Build produces Ant scripts based on development-time information provided by, for example, the plugin.xml and build.properties files. The generated Ant scripts, can fetch the relevant projects from a CVS repository, build jars, Javadoc, source zips, put everything together in a format ready to ship and send it out to a remote location (e.g., a local network or a downloads server).”

Well the major 2 advantages that you achieve by shifting RCP products to such builds are:

  • No need to maintain separate build files for every plugin
  • No need to keep track of plugin dependencies in such build files (rather dependencies are resolved by the build system)

Although the above two points are very evident they can become a real pain if the number of plugins are large ( 80-100 dependant plugins sound fun for a starter like me) .

Different Approaches for Dependant PDE builds:

Before even scratching PDE i went through a lot of blogs and links. All of them explained PDE and related stuff pretty well but none of them showed me methods for dependant PDE systems. Here i will explain deiffrent approaches that i followed while performing PDE for SONIC WorkBench.

Some basic assumptions:

  • Product P depends on 3 fragment plugin say  A, B and C.
  • A, C can be built independently and do not depend on each other.
  • B depends on both A and C and can not be build before A and C.

Approach 1 :

  • Do not build A and C.
  • Dump every thing along with C including srcs of all the three A,B,C in one location
  • Build P3 against a fresh eclipse and include dependencies on C ,A in the feature plugin of B

Approach 2 :

  • Build A and C independently.
  • Dump this builds in the folder structure of B sources with their feature plugins in the feature folder of B
  • Build B against a fresh eclipse.

Approach 3 :

  • Build A and C independently.
  • Take a fresh eclipse and provision it with A and C builds.
  • Build B against the eclipse obtained after the above step

Approach 3 and Approach 2 extract out the real use of dependent PDE build system.

Approach 1 is more holistic and shows the power of PDE builds.

Approach 2 or 3 could be used to live up to expectations of large products which have large dependent components in which some of them can be built independently.

The following code fragments explain how the above concepts were implemented:

Download All the 3 plugins here

Approach 1

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: