Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » p2 site generation and required bundle versions
p2 site generation and required bundle versions [message #1125587] Fri, 04 October 2013 13:24 Go to next message
Terran Gilman is currently offline Terran Gilman
Messages: 67
Registered: July 2009
Member
It seems as though the p2.site generator is adding version ranges for required bundles even though the manifest does not provide version information.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: mybundle.name;singleton:=true
Bundle-Version: 4.3.2.qualifier
Bundle-Vendor: OPENMETHODS
Require-Bundle: org.eclipse.ui,
 org.eclipse.core.runtime,
 org.eclipse.ui.forms,
 org.eclipse.vtp.desktop.core,
 org.eclipse.vtp.desktop.model.core,
 org.eclipse.vtp.desktop.editors.themes.core,
 org.eclipse.vtp.desktop.editors.core,
 org.eclipse.vtp.desktop.model.elements.core,
 org.eclipse.vtp.desktop.projects.core,
 org.eclipse.vtp.framework.util,
 org.eclipse.vtp.framework.common,
 org.eclipse.vtp.desktop.export,
 org.eclipse.ui.ide,
 org.eclipse.vtp.desktop.model.interactive.core,
 org.eclipse.vtp.desktop.media.core,
 org.eclipse.core.resources,
 org.eclipse.vtp.framework.interactions.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy


Produces this entry in content.xml

    <unit id='mybundle.name' version='4.3.2.201310040826'>
      <update id='mybundle.name' range='[0.0.0,4.3.2.201310040826)' severity='0'/>
      <properties size='2'>
        <property name='org.eclipse.equinox.p2.name' value='Ui'/>
        <property name='org.eclipse.equinox.p2.provider' value='OPENMETHODS'/>
      </properties>
      <provides size='3'>
        <provided namespace='org.eclipse.equinox.p2.iu' name='mybundle.name' version='4.3.2.201310040826'/>
        <provided namespace='osgi.bundle' name='mybundle.name' version='4.3.2.201310040826'/>
        <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
      </provides>
      <requires size='18'>
        <required namespace='osgi.bundle' name='org.eclipse.ui' range='[3.7.0,4.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='[3.8.0,4.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.ui.forms' range='[3.5.0,4.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.model.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.editors.themes.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.editors.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.model.elements.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.projects.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.framework.util' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.framework.common' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.export' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.ui.ide' range='[3.7.0,4.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.model.interactive.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.desktop.media.core' range='[4.0.0,5.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.core.resources' range='[3.8.0,4.0.0)'/>
        <required namespace='osgi.bundle' name='org.eclipse.vtp.framework.interactions.core' range='[4.0.0,5.0.0)'/>
      </requires>
      <artifacts size='1'>
        <artifact classifier='osgi.bundle' id='com.openmethods.vht.modules.ui' version='4.3.2.201310040826'/>
      </artifacts>
      <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
      <touchpointData size='1'>
        <instructions size='2'>
          <instruction key='manifest'>
            Bundle-SymbolicName: mybundle.name;singleton:=true&#xA;Bundle-Version: 4.3.2.201310040826&#xA;
          </instruction>
          <instruction key='zipped'>
            true
          </instruction>
        </instructions>
      </touchpointData>
    </unit>


Where are those version numbers coming from? If I wanted to lock a version range I would have specified them in the manifest. Is there a way to turn this behavior off?
Re: p2 site generation and required bundle versions [message #1126408 is a reply to message #1125587] Sat, 05 October 2013 10:22 Go to previous message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1307
Registered: July 2009
Senior Member
On 04/10/2013 19:24, Terran Gilman wrote:
> It seems as though the p2.site generator is adding version ranges for
> required bundles even though the manifest does not provide version
> information.
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: Ui
> Bundle-SymbolicName: mybundle.name;singleton:=true
> Bundle-Version: 4.3.2.qualifier
> Bundle-Vendor: OPENMETHODS
> Require-Bundle: org.eclipse.ui,
> org.eclipse.core.runtime,
> org.eclipse.ui.forms,
> org.eclipse.vtp.desktop.core,
> org.eclipse.vtp.desktop.model.core,
> org.eclipse.vtp.desktop.editors.themes.core,
> org.eclipse.vtp.desktop.editors.core,
> org.eclipse.vtp.desktop.model.elements.core,
> org.eclipse.vtp.desktop.projects.core,
> org.eclipse.vtp.framework.util,
> org.eclipse.vtp.framework.common,
> org.eclipse.vtp.desktop.export,
> org.eclipse.ui.ide,
> org.eclipse.vtp.desktop.model.interactive.core,
> org.eclipse.vtp.desktop.media.core,
> org.eclipse.core.resources,
> org.eclipse.vtp.framework.interactions.core
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Bundle-ActivationPolicy: lazy
>
> Produces this entry in content.xml
>
> <unit id='mybundle.name' version='4.3.2.201310040826'>
> <update id='mybundle.name' range='[0.0.0,4.3.2.201310040826)'
> severity='0'/>
> <properties size='2'>
> <property name='org.eclipse.equinox.p2.name' value='Ui'/>
> <property name='org.eclipse.equinox.p2.provider'
> value='OPENMETHODS'/>
> </properties>
> <provides size='3'>
> <provided namespace='org.eclipse.equinox.p2.iu'
> name='mybundle.name' version='4.3.2.201310040826'/>
> <provided namespace='osgi.bundle' name='mybundle.name'
> version='4.3.2.201310040826'/>
> <provided namespace='org.eclipse.equinox.p2.eclipse.type'
> name='bundle' version='1.0.0'/>
> </provides>
> <requires size='18'>
> <required namespace='osgi.bundle' name='org.eclipse.ui'
> range='[3.7.0,4.0.0)'/>
> <required namespace='osgi.bundle' name='org.eclipse.core.runtime'
> range='[3.8.0,4.0.0)'/>
> <required namespace='osgi.bundle' name='org.eclipse.ui.forms'
> range='[3.5.0,4.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.model.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.editors.themes.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.editors.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.model.elements.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.projects.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.framework.util' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.framework.common' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.export' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle' name='org.eclipse.ui.ide'
> range='[3.7.0,4.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.model.interactive.core'
> range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.desktop.media.core' range='[4.0.0,5.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.core.resources' range='[3.8.0,4.0.0)'/>
> <required namespace='osgi.bundle'
> name='org.eclipse.vtp.framework.interactions.core' range='[4.0.0,5.0.0)'/>
> </requires>
> <artifacts size='1'>
> <artifact classifier='osgi.bundle'
> id='com.openmethods.vht.modules.ui' version='4.3.2.201310040826'/>
> </artifacts>
> <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
> <touchpointData size='1'>
> <instructions size='2'>
> <instruction key='manifest'>
> Bundle-SymbolicName: mybundle.name;singleton:=true
> Bundle-Version: 4.3.2.201310040826
>
> </instruction>
> <instruction key='zipped'>
> true
> </instruction>
> </instructions>
> </touchpointData>
> </unit>
>
> Where are those version numbers coming from? If I wanted to lock a
> version range I would have specified them in the manifest. Is there a
> way to turn this behavior off?

Hi there

there's a thread about that:
http://www.eclipse.org/forums/index.php/t/414150/

this is the intended behavior and it can be controlled:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=309147#c2

if you put a range (even an open one) it will be kept; otherwise, a
range is generated, the default is

compatible : The version will match major only.
1.2.3.abc -> [1.0.0,2.0.0)

personally, in my Xtext projects, I use in my MANIFESTS an explicit
minimal version range for things not related to Xtext, e.g., for Eclipse
Platform bundles, I use 3.5.0 so that my features can be installed in
older Eclipse versions. For Xtext bundles I leave the version range
empty, and I let site.p2 generate the versions for me using these custom
properties

# for versions not specified in the MANIFEST use
# [current-version unqualified,match major and minor)
# for instance, if you're using xtext 2.3.1.xxx and do not
# specify any range then the generated range will be
# [2.3.1,2.4.0)
pde.match.rule.bundle.lower=unqualified
pde.match.rule.bundle=equivalent

I don't know whether it is good practice, but it keeps me safe from new
releases of Xtext. When users install my stuff they will not get
versions of Xtext more recent (w.r.t. "minor") than the ones my projects
have been built (and tested) against.

Hope this helps
Lorenzo



--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Previous Topic:Making plugin-based ant tasks in a jar file known to Buckminster
Next Topic:Getting started building WindowBuilder with Buckminster
Goto Forum:
  


Current Time: Mon Jul 28 20:35:20 EDT 2014

Powered by FUDForum. Page generated in 0.12788 seconds