Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The "units.#." p2.inf entries create a new <a href="http://wiki.eclipse.org/Installable_Units" rel="noreferrer">Installable Unit</a>, they don't modify other existing IUs.</p> <p>You basically have to create an entire <a href="http://wiki.eclipse.org/Installable_Units#Installable_Unit_fragments" rel="noreferrer">Installable Unit fragment</a>. The fragment has the relevant instructions and attaches to your bundle's IU. Then you need to add a requirement from your feature to this new IU.</p> <p>PDE/Build does this automatically when building products. You could see the generated p2.inf by creating a little rcp product build which has a start level for your bundle.<br> The generated p2.inf in a product build will be <code>buildDirectory/features/org.eclipse.pde.build.container.feature/product/p2.inf</code></p> <p>Here is an example I modified from a build which sets the start level for <code>org.eclipse.equinox.common</code>. The <code>$version$</code> will get replaced by the version from the feature that the p2.inf belongs to. Notice the "hostRequirements", which is specifying the bundle we are a fragment of.</p> <pre><code>#create a requirement on the IU fragment we are creating requires.2.namespace=org.eclipse.equinox.p2.iu requires.2.name=configure.org.eclipse.equinox.common requires.2.range=[$version$,$version$] requires.2.greedy=true #create a IU frament named configure.org.eclipse.equinox.common units.0.id=configure.org.eclipse.equinox.common units.0.version=$version$ units.0.provides.1.namespace=org.eclipse.equinox.p2.iu units.0.provides.1.name=configure.org.eclipse.equinox.common units.0.provides.1.version=$version$ units.0.instructions.install=installBundle(bundle:${artifact}); units.0.instructions.uninstall=uninstallBundle(bundle:${artifact}); units.0.instructions.unconfigure=setStartLevel(startLevel:-1);markStarted(started:false); units.0.instructions.configure=setStartLevel(startLevel:2);markStarted(started:true); units.0.hostRequirements.1.namespace=osgi.bundle units.0.hostRequirements.1.name=org.eclipse.equinox.common units.0.hostRequirements.1.range=[3.6.0.v20100503,3.6.0.v20100503] units.0.hostRequirements.1.greedy=false units.0.hostRequirements.2.namespace=org.eclipse.equinox.p2.eclipse.type units.0.hostRequirements.2.name=bundle units.0.hostRequirements.2.range=[1.0.0,2.0.0) units.0.hostRequirements.2.greedy=false units.0.requires.1.namespace=osgi.bundle units.0.requires.1.name=org.eclipse.equinox.common units.0.requires.1.range=[3.6.0.v20100503,3.6.0.v20100503] units.0.requires.1.greedy=false </code></pre> <p>Answers to questions:</p> <ol> <li><p>0's, 1's, 2's</p> <p>These numbers are somewhat arbitrary, they serve only to separate one set of properties (<code>requires</code> or <code>units</code> or whatever) from another. The <code>requires</code> here used a '2' simply because I copied it from a large p2.inf that was generated by pde.build and forgot to change it like I did the units.0.</p></li> <li><p>Is all this necessary? </p> <p>Yes. The second <code>hostRequirements</code> on the type=bundle is needed. In Helios, with the exception of translation fragments, only one fragment can be attached to an IU. Generally a default IU is available that sets the default start level for all osgi bundles. In order for the our custom fragment to be chosen over the default one, it must have a higher "specificity" which is the number of satisfied host requirements.</p> <p>For "install"</p> <p>units.0.instructions.install=installBundle(bundle:${artifact}); units.0.instructions.uninstall=uninstallBundle(bundle:${artifact});</p> <p>The <code>instructions.install</code> and <code>instructions.uninstall</code> refer to phases of the p2 process. The <code>installBundle</code> and <code>uninstallBundle</code> refer to install/uninstall in the OSGi sense. Your bundle must be installed into the OSGi system before you can do anything else. This basically invovles adding it to the config.ini or org.eclipse.equinox.simpleconfigurator/bundles.info files.</p> <p>Most p2 installs will already contain a default configuration IU that will install and set the default start level (4) for bundles. However, currently only one configuration fragment can be applied to each bundle, so when you add your own like this the default no longer applied to your bundle.</p></li> <li><p>hostRequirements. The installable Unit fragments page just describes what a fragment is with no reference on how to create one. It is biefly mentioned on the <a href="http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata" rel="noreferrer">Customizing Metadata</a> page, but not explained.</p> <p>Documentation, there is a bunch of stuff on the wiki under the <a href="http://wiki.eclipse.org/Category:Equinox_p2" rel="noreferrer">p2 category</a>. the page on the <a href="http://wiki.eclipse.org/Equinox/p2/Engine/Touchpoint_Instructions" rel="noreferrer">touchpoint instructions</a> might be interesting. There is some help on <a href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_overview.htm" rel="noreferrer">help.eclipse.org</a>, but in general, I think this is a bit more advanced that what there is documentation for.</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload