Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support version ranges and no versions for units in target definitions #1245

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HannesWell
Copy link
Member

@HannesWell HannesWell commented Apr 21, 2024

This is an early draft to add support for version ranges and no versions for unit elements in target-definitions.

This allows users to omit the version attribute in a unit element (which is equivalent to the value 0.0.0) or to specify a range (in the usual OSGi synax) as its value.

For example:

<target name="myTarget">
	<locations>
		<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
			<repository location="https://download.eclipse.org/releases/2023-12/"/>
			<unit id="org.eclipse.sdk.feature.group" version="0.0.0"/>
			<unit id="org.eclipse.m2e.sdk.feature.feature.group" />
			<unit id="com.google.guava" version="[30,40)"/>
		</location>
	</locations>
</target>

Resolves to
grafik

This also contains two commits with code clean-ups in the target handling that I plan to provide as separate PR soon.

There are still a few things to work out regarding removal of IUs and Updating the target and the UI should probably also be adapted, but the most basic functionality is already working.

Fixes #757

Copy link

Test Results

  273 files   -    18    273 suites   - 18   36m 47s ⏱️ - 28m 1s
  900 tests  - 2 626    863 ✅  - 2 605   34 💤  - 24  0 ❌ ±0  3 🔥 +3 
2 766 runs   - 8 109  2 652 ✅  - 8 046  105 💤  - 72  0 ❌ ±0  9 🔥 +9 

For more details on these errors, see this check.

Results for commit 42ebff6. ± Comparison against base commit b8c244d.

This pull request removes 2626 tests.
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test1
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test2
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test3
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test4
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test5
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test6
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingAnalysisAntTaskTests ‑ test7
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test1
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test2
org.eclipse.pde.api.tools.anttasks.tests.ApiToolingApiFreezeAntTaskTests ‑ test3
…

@merks
Copy link
Contributor

merks commented Apr 21, 2024

I guess support for this in tycho is implemented separately.

@laeubi
Copy link
Contributor

laeubi commented Apr 29, 2024

I guess support for this in tycho is implemented separately.

Yes that's the only drawback this will immediately make the target file incompatible to any older Eclipse or Tycho version :-\

Theoretically there is a "target version" processing instruction, so maybe we should try to use that to make at least PDE aware of the incompatibility?

@laeubi
Copy link
Contributor

laeubi commented Jul 14, 2024

Just one thing about the UI I think in such a case we should adapt the labelprovider to show the range + the resolved version.

Also then we need some UI to edit the version (range) e.g. in the wizard there could be an additional radio option to use:

  1. use exact version
  2. use latest version
  3. use latest excluding next major

and of course the most challenging thing will be if one edit such a location so it retains the exiting version ranges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Target file - Remove the need to specify a 0.0.0 version
3 participants