Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 264266 - [publisher] complete support for version advice
Summary: [publisher] complete support for version advice
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: P2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 264724 264746
  Show dependency tree
 
Reported: 2009-02-09 17:21 EST by Jeff McAffer CLA
Modified: 2009-02-25 18:10 EST (History)
2 users (show)

See Also:


Attachments
Adds version advice from property file (7.23 KB, patch)
2009-02-24 19:12 EST, Ian Bull CLA
no flags Details | Diff
mylyn/context/zip (29.75 KB, application/octet-stream)
2009-02-24 19:12 EST, Ian Bull CLA
no flags Details
Updated patch (11.97 KB, patch)
2009-02-25 13:07 EST, Ian Bull CLA
aniefer: iplog+
Details | Diff
mylyn/context/zip (13.55 KB, application/octet-stream)
2009-02-25 13:07 EST, Ian Bull CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff McAffer CLA 2009-02-09 17:21:19 EST
Currently VersionAdvice.load is a stubbed out method that should be reading the version advice file produced by PDE Build (or whoever).  The code needed for readin gthe file is in PDE build's ProductQuery.loadVersions().  We should be able to copy and use.
Comment 1 Ian Bull CLA 2009-02-24 19:12:05 EST
Created attachment 126643 [details]
Adds version advice from property file

This patch loads version advice from a property file. I assume this is just a standard property file (key=value).

I have also added a few test cases.  This patch can be reviewed.
Comment 2 Ian Bull CLA 2009-02-24 19:12:16 EST
Created attachment 126644 [details]
mylyn/context/zip
Comment 3 Andrew Niefer CLA 2009-02-25 08:44:04 EST
A common source for such advice will be property files generated by pde.build, the format there is like this:
org.eclipse.core.runtime=3.5.0.v20090223
org.eclipse.core.runtime_3.5.0=3.5.0.v20090223
org.eclipse.core.runtime_3.4.0=3.4.0.v20080512

Particularly, if there is more than one version of a bundle, then the property <bundle-id> will indicate the highest version.  And <bundle-id>_<3segments> properties indicate the other available versions.

I don't know if we have any need for this extra information, but it is there if we can think of a way to use it.

We may also want to be able to give no/null namespace when providing these properties and have them used for any namespace.  Have perhaps a special default "*", and when someone asks for a version, we first check the namespace as we do now and if we don't find anything, we then check a default "*" namespace.
Comment 4 Ian Bull CLA 2009-02-25 13:07:10 EST
Created attachment 126758 [details]
Updated patch

This patch adds the null namespace as Andrew has suggested.  If the same bundle is added twice, the second one wins.

I don't think there is anything todo for the multiple versions.  If somebody queries for org.eclipse.core.runtime they will get the version in the file.  If somebody queries for org.eclipse.core.runtime_3.4.0 this will be seen as a different string.

I have also remvoe setVersion from the IVersionAdvice interface.  I don't think it makes sense for anyone to "set" advice. Advice is asked for by the publisher, not given (IMHO).
Comment 5 Ian Bull CLA 2009-02-25 13:07:18 EST
Created attachment 126759 [details]
mylyn/context/zip
Comment 6 Andrew Niefer CLA 2009-02-25 18:10:38 EST
released.