Skip to content

Conversation

@akoch-yatta
Copy link
Contributor

With the SVG rasterizer contributed as separate project to SWT, running pure Java Snippets did not work out of the box, when the SVG project was added to the workspace. This commit moves the service provider configuration into a separate source folder so it will be properly initialized in this use case as well.

@akoch-yatta akoch-yatta linked an issue Sep 3, 2025 that may be closed by this pull request
@eclipse-platform-bot
Copy link
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

bundles/org.eclipse.swt.svg/META-INF/MANIFEST.MF

Warning

🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit.

Git patch
From 1a65e1f505b5fc37461c48a56c7ef41b3fb3329d Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <[email protected]>
Date: Wed, 3 Sep 2025 10:55:25 +0000
Subject: [PATCH] Version bump(s) for 4.38 stream


diff --git a/bundles/org.eclipse.swt.svg/META-INF/MANIFEST.MF b/bundles/org.eclipse.swt.svg/META-INF/MANIFEST.MF
index 1ee3b0126d..d63ef6cc16 100644
--- a/bundles/org.eclipse.swt.svg/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.swt.svg/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-SymbolicName: org.eclipse.swt.svg
-Bundle-Version: 3.130.100.qualifier
+Bundle-Version: 3.130.200.qualifier
 Automatic-Module-Name: org.eclipse.swt.svg
 Bundle-Name: %fragmentName
 Bundle-Vendor: %providerName
-- 
2.51.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 3, 2025

Test Results

   546 files  + 7     546 suites  +7   31m 11s ⏱️ + 1m 22s
 4 426 tests +54   4 409 ✅ +52   17 💤 +3  0 ❌  - 1 
16 750 runs  +54  16 623 ✅ +52  127 💤 +3  0 ❌  - 1 

Results for commit ffde040. ± Comparison against base commit 7466be6.

♻️ This comment has been updated with latest results.

@akoch-yatta akoch-yatta force-pushed the svg-add-service-to-source-folder branch from 30f4e26 to f5adf00 Compare September 3, 2025 12:39
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Works as expected. This avoids that for standalone usage of SWT from source code (not packages as JAR) a workaround such as the one proposed in #2228 has to be applied when one wants to use SVGs.

Practically, it allows to run SWT snippets that make use of SVGs (without any modifications as per the referenced comment above) and also to run the SVGRasterizer tests as pure JUnit tests (instead of plug-in tests): Test_org_eclipse_swt_internal_SVGRasterizer.

I also ran a local build to verify that the service declaration is definitely embedded into the final JAR.

@HeikoKlare HeikoKlare force-pushed the svg-add-service-to-source-folder branch from f5adf00 to d14b11e Compare September 4, 2025 06:14
@laeubi
Copy link
Contributor

laeubi commented Sep 4, 2025

With the SVG rasterizer contributed as separate project to SWT, running pure Java Snippets did not work out of the box, when the SVG project was added to the workspace.

Yes this is currently a limitation on how JDT/PDE works when it comes to different resource handling.

This commit moves the service provider configuration into a separate source folder so it will be properly initialized in this use case as well.

Any reason we need an additional source folder instead of just placing it in the existing one?

@HeikoKlare
Copy link
Contributor

Any reason we need an additional source folder instead of just placing it in the existing one?

I don't think there is any need to do it. It is just to not mess up the actual source code folder with additional resources. Just like done in a default Maven setup with separate "src/java" and "src/resources" source folders.

With the SVG rasterizer contributed as separate project to SWT, running
pure Java Snippets did not work out of the box, when the SVG project
was added to the workspace. This commit moves the service provider
configuration into a separate source folder so it will be properly
initialized in this use case as well.
@HeikoKlare HeikoKlare force-pushed the svg-add-service-to-source-folder branch from d14b11e to ffde040 Compare September 4, 2025 14:32
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

M2e is using excluding="**" that seem to prevent java files from being processed in such resource only folders.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's the concrete proposal/question here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<classpathentry kind="src" path="resources"/>
<classpathentry kind="src" path="resources" excluding="**"/>

that should prevent any java files from being placed here so you get a real "resource only" folder.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, I understand the idea, but (1) it's also a bit weird that if you place a Java file into an actual source folder (no matter whether it's called "resources") is not considered and (2) the pattern appears completely incomprehensible to me, so I am not sure if anywill will understand what this is supposed to do when taking a look at it or when dealing with issues potentially arising from it.

Copy link
Contributor

@laeubi laeubi Sep 4, 2025

Choose a reason for hiding this comment

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

You wanted a "resource folder like maven" and that is how maven does it (or more formally m2e). That it is a "source folder" is an implementation detail of JDT because no one has minded to actually implement it like in maven (where resources can also be filtered for example before copied)

Copy link
Contributor

Choose a reason for hiding this comment

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

Just tested and adding excluding="**" completely excludes the directory, thus rendering the change completely useless as the service file will not be placed in the bin folder anymore.

@HeikoKlare HeikoKlare merged commit ae2bb1d into eclipse-platform:master Sep 4, 2025
17 checks passed
@HeikoKlare HeikoKlare deleted the svg-add-service-to-source-folder branch September 4, 2025 15:15
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.

Add SVG rasterizer to source folder

4 participants