Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » [p2] use p2.inf to configure bundles within feature
[p2] use p2.inf to configure bundles within feature [message #480756] Tue, 18 August 2009 12:35 Go to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

I have a feature containing 2 bundles and would like to set the start
level for the 2 bundles. How can I do that? Just using

instructions.configure=\
org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel: 4);\
org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(starte d: true);

does not work. What am I missing?

Thanks,
Luzi
Re: [p2] use p2.inf to configure bundles within feature [message #480789 is a reply to message #480756] Tue, 18 August 2009 13:48 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Is the p2.inf co-located with the bundles?
-Simon

"Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
news:h6e76e$k6h$1@build.eclipse.org...
>I have a feature containing 2 bundles and would like to set the start level
>for the 2 bundles. How can I do that? Just using
>
> instructions.configure=\
> org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel: 4);\
> org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(starte d: true);
>
> does not work. What am I missing?
>
> Thanks,
> Luzi
Re: [p2] use p2.inf to configure bundles within feature [message #480799 is a reply to message #480789] Tue, 18 August 2009 14:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

No, I would like to have the p2.inf within the feature. We want to reuse
the bundle in different scenarios. Thus, I cannot put the p2.inf into
the bundle. If I put the p2.inf in the META-INF directory of the bundle,
then I can set the start level as described below.

> Is the p2.inf co-located with the bundles?
> -Simon
>
> "Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
> news:h6e76e$k6h$1@build.eclipse.org...
>> I have a feature containing 2 bundles and would like to set the start level
>> for the 2 bundles. How can I do that? Just using
>>
>> instructions.configure=\
>> org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel: 4);\
>> org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(starte d: true);
>>
>> does not work. What am I missing?
>>
>> Thanks,
>> Luzi
>
>
Re: [p2] use p2.inf to configure bundles within feature [message #480805 is a reply to message #480799] Tue, 18 August 2009 14:40 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
Ok. If that's the case then you have a bit more work. What you'll have to do
is in the feature craft IUFragments that reference the bundle IUs and do the
configuring in the IUFragments. See
http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata#Addi tional_Installable_Unit_Advice:

To make an IU a fragment declare a "hostRequirement" on the bundle IUs.
What you'll end up with is a p2.inf something like this:

# Add the requirement for the first fragment to the feature
requires.1.namespace = org.eclipse.equinox.p2.iu
requires.1.name = mybundle1.fragment
requires.1.range = 1.0.0

# Add the requirement for the second fragment to the feature
requires.2.namespace = org.eclipse.equinox.p2.iu
requires.2.name = mybundle2.fragment
requires.2.range = 1.0.0

# Create the first fragment
units.1.id = mybundle1.fragment
units.1.version = 1.0.0
units.1.singleton = true
units.1.provides.0.namespace = org.eclipse.equinox.p2.iu
units.1.provides.0.name = mybundle1.fragment
units.1.provides.0.version = 1.0.0
units.1.instructions.configure =
org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel:
4);org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(sta rted: true);
units.1.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.1.hostRequirements.0.name = mybundle1
units.1.hostRequirements.0.range = 1.0.0

# Create the second fragment
units.2.id = mybundle1.fragment
units.2.version = 1.0.0
units.2.singleton = true
units.2.provides.0.namespace = org.eclipse.equinox.p2.iu
units.2.provides.0.name = mybundle2.fragment
units.2.provides.0.version = 1.0.0
units.2.instructions.configure =
org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel:
4);org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(sta rted: true);
units.2.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.2.hostRequirements.0.name = mybundle2
units.2.hostRequirements.0.range = 1.0.0

--
Note: This is just an example as I haven't tried this out. You probably
would want to publish this feature and verify everything looks correct in
the IU xml.

HTH
-Simon

"Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
news:h6ed7h$ra3$1@build.eclipse.org...
> No, I would like to have the p2.inf within the feature. We want to reuse
> the bundle in different scenarios. Thus, I cannot put the p2.inf into the
> bundle. If I put the p2.inf in the META-INF directory of the bundle, then
> I can set the start level as described below.
>
>> Is the p2.inf co-located with the bundles?
>> -Simon
>>
>> "Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
>> news:h6e76e$k6h$1@build.eclipse.org...
>>> I have a feature containing 2 bundles and would like to set the start
>>> level for the 2 bundles. How can I do that? Just using
>>>
>>> instructions.configure=\
>>> org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(star tLevel:
>>> 4);\
>>> org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(starte d: true);
>>>
>>> does not work. What am I missing?
>>>
>>> Thanks,
>>> Luzi
>>
Re: [p2] use p2.inf to configure bundles within feature [message #481033 is a reply to message #480805] Wed, 19 August 2009 12:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

Thanks for the info. I tried with your proposal, but it did not work.
The bundle is installed, but my settings are not taken into
consideration. Moreover, the bundle does not show up in the
bundles.info. The IU xml looks ok for me but my experience with IU xml's
is very limited. Any tipps, how I can debug the installation procedure
or verify the IU xml?

Luzi
Re: [p2] use p2.inf to configure bundles within feature [message #481096 is a reply to message #481033] Wed, 19 August 2009 15:41 Go to previous messageGo to next message
Simon Kaegi is currently offline Simon KaegiFriend
Messages: 381
Registered: July 2009
Senior Member
"Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
news:h6gpjh$3cq$1@build.eclipse.org...
> Thanks for the info. I tried with your proposal, but it did not work. The
> bundle is installed, but my settings are not taken into consideration.
> Moreover, the bundle does not show up in the bundles.info.

Doh. We of course still need the fragment to provide install and uninstall
instructions

e.g.
units.1.instructions.install =
org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bund le:${artifact})
units.1.instructions.uninstall =
org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bu ndle:${artifact})

units.2.instructions.install =
org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bund le:${artifact})
units.2.instructions.uninstall =
org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bu ndle:${artifact})


The IU xml looks ok for me but my experience with IU xml's
> is very limited. Any tipps, how I can debug the installation procedure or
> verify the IU xml?

You can post the IUs that were generated for the feature, two bundles, and
two fragments and I (or others) can take a look.
-Simon
Re: [p2] use p2.inf to configure bundles within feature [message #481304 is a reply to message #481096] Thu, 20 August 2009 12:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luzi.anderegg.ergon.ch

The instructions below let the bundle appear in my product.
Thanks Simon for your help!

Simon Kaegi wrote:
> "Luzi Anderegg" <luzi.anderegg@ergon.ch> wrote in message
> news:h6gpjh$3cq$1@build.eclipse.org...
>> Thanks for the info. I tried with your proposal, but it did not work. The
>> bundle is installed, but my settings are not taken into consideration.
>> Moreover, the bundle does not show up in the bundles.info.
>
> Doh. We of course still need the fragment to provide install and uninstall
> instructions
>
> e.g.
> units.1.instructions.install =
> org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bund le:${artifact})
> units.1.instructions.uninstall =
> org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bu ndle:${artifact})
>
> units.2.instructions.install =
> org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bund le:${artifact})
> units.2.instructions.uninstall =
> org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bu ndle:${artifact})
>
>
> The IU xml looks ok for me but my experience with IU xml's
>> is very limited. Any tipps, how I can debug the installation procedure or
>> verify the IU xml?
>
> You can post the IUs that were generated for the feature, two bundles, and
> two fragments and I (or others) can take a look.
> -Simon
>
>
Re: [p2] use p2.inf to configure bundles within feature [message #1778325 is a reply to message #481304] Wed, 13 December 2017 07:48 Go to previous messageGo to next message
Marco Descher is currently offline Marco DescherFriend
Messages: 197
Registered: October 2010
Location: Austria
Senior Member
Just googled this - which really helped me out!
I summarize this for further reference:

1. Add a p2.inf to the features META-INF/ directory
2. To e.g. set the startlevel to 1 with autostart true for a bundle named org.eclipse.gemini.naming contained in the respective feature, p2.inf has to look like this

# Set start level for gemini.namining
requires.1.namespace = org.eclipse.equinox.p2.iu
requires.1.name = naming.bundle.fragment
requires.1.range = 1.0.0

units.1.id = naming.bundle.fragment
units.1.version = 1.0.0
units.1.singleton = true
units.1.provides.0.namespace = org.eclipse.equinox.p2.iu
units.1.provides.0.name = naming.bundle.fragment
units.1.provides.0.version = 1.0.0
units.1.instructions.configure = setStartLevel(startLevel:1);markStarted(started: true);
units.1.hostRequirements.0.namespace = org.eclipse.equinox.p2.iu
units.1.hostRequirements.0.name = org.eclipse.gemini.naming
units.1.hostRequirements.0.version = 0.0.0
units.1.instructions.install = installBundle(bundle:${artifact})
units.1.instructions.uninstall = uninstallBundle(bundle:${artifact})
Re: [p2] use p2.inf to configure bundles within feature [message #1796277 is a reply to message #1778325] Tue, 09 October 2018 12:35 Go to previous message
ilke Muhtar is currently offline ilke MuhtarFriend
Messages: 47
Registered: September 2015
Member
How can I make 2 p2.inf files in different meta-inf folder run one after other ?

Please have a look to my question link :

https://stackoverflow.com/questions/52666844/how-to-trigger-multiple-changes-via-different-p2-inf-files-in-eclipse
Previous Topic:p2.inf to define optional dependency from feature to plugin?
Next Topic:Performance degradation after upgrade from org.eclipse.osgi 3.9.1 to higher versions 3.10+
Goto Forum:
  


Current Time: Tue Apr 23 13:58:30 GMT 2024

Powered by FUDForum. Page generated in 0.03563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top