ECLIPSE AND DEPENDENT PDE BUILDS
The primary reason for blogging on this topic is that i found a lot of blogs that explain how PDE build can be used but not a lot of blogs explain how can we use dependent builds using the above system.
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 :P) .
Different Approaches for Dependant PDE builds:
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.
Download All the 3 plugins here