Skip to content

Conversation

HeikoKlare
Copy link
Contributor

@HeikoKlare HeikoKlare commented Oct 7, 2025

This removes the unnecessary package export for org.eclipse.swt.svg from the SVG fragment. It limits usage to the test bundle in which tests of the JSVG rasterizer class reference that class.

I've also added a PR for Platform UI with API filters for the bundles reexporting SWT, which has to be merged together with this one (or right after):

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Test Results

  115 files  ±0    115 suites  ±0   10m 23s ⏱️ - 1m 23s
4 546 tests ±0  4 530 ✅ ±0  16 💤 ±0  0 ❌ ±0 
  311 runs  ±0    308 ✅ ±0   3 💤 ±0  0 ❌ ±0 

Results for commit 2fa8d0a. ± Comparison against base commit 3a013ef.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare requested a review from HannesWell October 7, 2025 14:26
com.github.weisj.jsvg.parser;version="[2.0.0,3.0.0)",
com.github.weisj.jsvg.view;version="[2.0.0,3.0.0)"
Export-Package: org.eclipse.swt.svg
Export-Package: org.eclipse.swt.svg;x-friends:="org.eclipse.swt.tests"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to not add the tests as a friend but the mark the package as x-internal entirely and suppress the warning in the test instead.
Having the tests mentioned in the host bundle is IMO not clean and has the potential to be left-over in case the friend is not necessary anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true. I actually though about entirely moving the tests to the fragment, as that's where they belong (since they do not test API and since we cannot have a test fragment for a fragment). But it would require to add the same additional configuration we have added for tests inside the win32 fragment and I was not sure whether it's worth for just this fragment, so it's probably fine to suppress the restriction warnings instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds good in general, but I agree that it's benefit is questionable.

@HeikoKlare HeikoKlare force-pushed the jsvg-remove-export branch 2 times, most recently from 5796731 to 4f0e75b Compare October 7, 2025 18:12
Copy link
Member

@HannesWell HannesWell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks for this clean-up.

com.github.weisj.jsvg.parser;version="[2.0.0,3.0.0)",
com.github.weisj.jsvg.view;version="[2.0.0,3.0.0)"
Export-Package: org.eclipse.swt.svg
Export-Package: org.eclipse.swt.svg;x-internal:=true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the commit message is confusing... this does not remove the export it only marks it as internal ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I didn't properly update the message when replacing the previous x-friends. Do we need the internal flag at all or couldn't we just completely remove the export? What's the benefit of keeping it like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The export is only needed if you import it somewhere of course... not sure where is is really used, if its only for test thex look to me that they can be plain surefire tests without OSGI and then package exports should not matter at all (you might want jar.extra classpath instead to make PDE IDE happy)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only usage is in org.eclipse.swt.test and there we don't use a package import, so it should not matter? At least I do not see any complain in my IDE when simply removing the export here.
And yes, those tests could be plain surefire tests and could also be placed inside that fragment, as discussed in the comments above: #2602 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, the build properly complains, only my IDE did not. I changed to x-internal again and adapted the commit message.

@HeikoKlare HeikoKlare force-pushed the jsvg-remove-export branch 2 times, most recently from 916a304 to 39d445d Compare October 8, 2025 08:42
This mark the package export for org.eclipse.swt.svg from the SVG
fragment as internal because it's only required by tests.
@HeikoKlare HeikoKlare merged commit fd40dba into eclipse-platform:master Oct 9, 2025
17 checks passed
@HeikoKlare HeikoKlare deleted the jsvg-remove-export branch October 9, 2025 20:47
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.

3 participants