[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.technology.equinox] Re: [p2] use p2.inf to configure bundles within feature
|
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#Additional_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(startLevel:
4);org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started: 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(startLevel:
4);org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started: 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@xxxxxxxx> wrote in message
news:h6ed7h$ra3$1@xxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxx> wrote in message
>> news:h6e76e$k6h$1@xxxxxxxxxxxxxxxxxxxx
>>> 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(startLevel:
>>> 4);\
>>> org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started: true);
>>>
>>> does not work. What am I missing?
>>>
>>> Thanks,
>>> Luzi
>>