p2: Uncovering your kludgy code
In EMFland, we have some crazy-old internal FVT, BVT, and SVT tests that we run as a followup to our public JUnits. These are rather complex, involving codegen, hooking into PDE in less-than-standard ways, and doing all sorts of wierd modeling test work.
Unfortunately, they break a few times a year, and this time it took the better part of a week to sort out why. Ultimately, it comes down to the fact that p2 wants to do things smarter than its predecessor, and so some of the old hacks don’t work anymore.
The lessons learned here are:
- If you still haven’t migrated from plugin.xml to MANIFEST.MF, you should. PDE UI provides a super-simple way to do this — just open the plugin.xml in the manifest editor, and on the Overview tab, select ‘create an OSGi bundle manifest’. (bug 224234)
- If you must hook into
<eclipse.buildScript>by hand, use thepluginPathattribute to help resolve your plugins. For example, use: ${eclipseDir}:${eclipseDir}/plugins:${dropinsDir}/eclipse:${dropinsDir}/eclipse/plugins. Might be overkill, but it works. (bug 224234#c3) - Ensure that your headless eclipse install, which is compiling and running your tests, includes both plugins AND any related features. The features might not actually be required, but why not include them so that you’re more closely synthesizing the user’s runtime? (bug 224195#c11)
- If you encounter a situation where it seems your bundles aren’t loading and therefore code’s not compiling & tests are failing, you can always play with the OSGi console to verify you’re not going crazy. (Console)
- Use eclipse/dropins/ instead of just eclipse/ for all your runtime and test plugins. (Migration)
- Never attempt to “clean” eclipse by hand by deleting most of the stuff in eclipse/configuration/. Instead, back up your dropins/ folder, use a minty-fresh eclipse w/ a complete configuration/ folder, and copy anything else you need back into eclipse/dropins/. (bug 224195#c11)
Posted April 2nd, 2008 by in category: ant, classpath, features, p2, pde, scripting, testing
You can skip to the end and leave a response. Pinging is currently not allowed.
Leave a Reply
You must be logged in using your Eclipse Bugzilla account to post a comment.

