Slicing and dicing the p2 way

>> Tuesday, March 03, 2009

We've traditionally used the packager to craft the features that are available on our download page from the signed bundles in our master feature. However, the packager isn't very efficient because it unzips all of the input feature to the packaging process, regardless of the bundles that are actually needed. Also the packager can be confusing for new users to configure. The packager also doesn't include metadata in the resultant zips. As my neighbour Pascal says, metadata matters. We'd like for people to reconsume the metadata that we create during the build instead of recreating it, possibly with errors.

In the M6, the p2.mirror task in the bundle was introduced. This task provides a much more flexible and efficient mechanism for slicing and dicing bundles from a repo into a smaller repo. For instance, to assemble the components of the Equinox SDK from a repo, this command will do the trick:

<p2.mirror source="file://${buildRepo}">
<destination kind="metadata" location="file://${featureTemp}" name="My Equinox repo" format="file://${buildRepo}" />
<destination kind="artifact" location="file://${featureTemp}" name="My Equinox repo" format="file://${buildRepo}" />
<iu id="" version="" />
<iu id="" version="" />
<slicingOptions platformFilter="true" includeOptional="false" includeNonGreedy="false" followStrict="true" />

This resulting content will include all the bundles associated with the and IU's as referenced in the content.jar. The version of these IU's is not specified which means that the highest version will be selected from the repo. Conversely, you could specify a version. The platformFilter="true" means that all platform specific fragments associated with this iu will be provisioned.

A simple and fast slicer. For the low low price of $19.95. Wait, it's free. Try it out today.

For more information, see

bug 262083

bug 265208


Chris Aniszczyk (zx) 9:45 AM  

Very cool! I hope the documentation in the SDK gets updated with this information!

krab-spb 8:01 AM  

Just one question - there is p2 site with set of different platform specific fragments. Is it possible to set slicing options to mirror only several platforms?
For example I need next set of platforms:
win32, win32, x86 &
linux, gtk, x86 &
linux, motif, x86 &
macosx, carbon, x86?

Kim Moir 1:41 PM  


Yes, from the doc...use platformFilter

platformFilter An "os,ws,arch" triplet to set as the platform against which IU LDAP filters will be matched. IUs not matching the filter will not be mirrored.

Post a Comment

  © Blogger template Simple n' Sweet by 2009

Back to TOP