| Summary: | set-version mojo should update version ranges | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Sebastien Arod <sebastien.arod> | ||||
| Component: | Tycho | Assignee: | Jan Sievers <jan.sievers> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | jan.sievers, Martin.SCHREIBER, michael, sebastien.arod, vincent.guignot | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| See Also: |
https://git.eclipse.org/r/57228 https://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=bd715d9dc044256e9298a8b71cbab2b910f6623c |
||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
I think exact versions must be updated anyway, e.g. Fragment-Host: thehostbundle;bundle-version="1.0.0" should be updated without having such an option - right? The option might be something like "updateVersionBounds" which can be updateVersionBounds=lower updateVersionBounds=upper updateVersionBounds=both and according to the value, the lower, upper or both version bounds are updated for Required-Bundle and Fragment-Hosts are updated if the old version matches that bound. What do you think about that? (In reply to Martin Schreiber from comment #1) > I think exact versions must be updated anyway, e.g. > > Fragment-Host: thehostbundle;bundle-version="1.0.0" > > should be updated without having such an option - right? not sure if that is actually a lower bound only (at least for Require-Bundle a single bundle-version is a shorthand for a lower bound without upper bound IIRC) need to check the OSGi spec. > > The option might be something like "updateVersionBounds" which can be > > updateVersionBounds=lower > updateVersionBounds=upper > updateVersionBounds=both > > and according to the value, the lower, upper or both version bounds are > updated for Required-Bundle and Fragment-Hosts are updated if the old > version matches that bound. > > What do you think about that? generally speaking, the problem occurs only if the new (increased) version is outside of the dependency version range. In the normal case (version increase) this means only the upper bound (if any) must be increased. Updating both upper and lower bound may also make sense if you want a perfect version match. Not sure if updating the lower bound only makes sense. The only scenario I can imagine where this may be needed is if you decrease the version; that is a strange usecase IMHO. (In reply to Jan Sievers from comment #2) > (In reply to Martin Schreiber from comment #1) > > I think exact versions must be updated anyway, e.g. > > > > Fragment-Host: thehostbundle;bundle-version="1.0.0" > > > > should be updated without having such an option - right? > > not sure if that is actually a lower bound only (at least for Require-Bundle > a single bundle-version is a shorthand for a lower bound without upper bound > IIRC) need to check the OSGi spec. If a single version is specified it is a lower bound: From the OSGI spec https://osgi.org/download/r5/osgi.core-5.0.0.pdf#G5.3189033 "If a version range is specified as a single version, it must be interpreted as the range [version,∞)" Would you accept contribution on this enhancement? (In reply to Sebastien Arod from comment #4) > Would you accept contribution on this enhancement? sure. See https://wiki.eclipse.org/Tycho/Contributor_Guide on how to contribute you may also want to update the bug title to "set-version mojo should update version ranges if new version is outside range" (at least this is what I understood from the discussion) IMHO Changing version when newVersion starts being outside of the range should be automatic otherwise the project will stop compiling after set-version execution. In practice this can happen when * Ranges with lower bounds and upper bounds are used and version is set outside the range * Use lower bounds only and use set-version to set a lower version number. This is probably quite rare. However it is also useful to support configuring set-version to update the lower bound if it matches to keep it "in sync" with the referenced bundle. This was my original use-case. So we would probably need a boolean option alwaysUpdateMatchingBounds to keep in sync lower bounds and upper bounds if they were matching the original version regardless of newVersion being in or out of scope. WDYT? New Gerrit change created: https://git.eclipse.org/r/57228 WARNING: this patchset contains 1370 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire I pushed a change proposal to Gerrit based what I wrote in my last comment. Hi I pushed the changes to gerrit 10 days ago and didn't get any feedback. I tried to explain the best I could in the commit message what I add to change and why. Let me know if anything needs to be clarified or if you need more information to facilitate the review. (In reply to Sebastien Arod from comment #9) > Hi I pushed the changes to gerrit 10 days ago and didn't get any feedback. > > I tried to explain the best I could in the commit message what I add to > change and why. Let me know if anything needs to be clarified or if you need > more information to facilitate the review. I was simply busy. will try to find the time this week. WARNING: this patchset contains 1489 new lines of code and requires a Contribution Questionnaire (CQ), as author sebastien.arod@gmail.com is not a committer on tycho/org.eclipse.tycho. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire Are you waiting for something from me? I tried to follow the link to the CQ but it requires a committer login. (In reply to Sebastien Arod from comment #12) > Are you waiting for something from me? > I tried to follow the link to the CQ but it requires a committer login. no, it's now up to the eclipse IP team to review the patch from a legal point of view and give the OK. Once we have the OK we can submit. Sorry for the process overhead but this is how the eclipse IP process works. I'd like to get this into 0.24.0 next week but I cannot influence how quick the IP team will do the review, let's see. hint for next time: smaller patches (< 1000 LOC) do not require CQ CQ 10277 was approved I will merge now Gerrit change https://git.eclipse.org/r/57228 was merged to [master]. Commit: http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=bd715d9dc044256e9298a8b71cbab2b910f6623c thanks for your patch Sebastien and sorry for the delay in IP review! No problem thanks for the merge. Next time I'll try to make smaller contributions :) |
Created attachment 256545 [details] Sample project to play with set-version I'm using tycho set-version to change my version numbers. The documentation states that "it consistently updates the version strings in the project's configuration files (e.g. pom.xml and META-INF/MANIFEST.MF) and all references to that project (e.g. in a feature.xml)." However references from other bundles (using Require-Bundle) and references from fragment (using Fragment-Host) for which the lower bound matches the current version are not updated. It would be nice to have an option to update matching lower bounds version.