-
Notifications
You must be signed in to change notification settings - Fork 204
Add JDT classpath attribute support for multi-release JAR compilation #5627
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
Conversation
laeubi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot please look at the review comments some things have to be adjusted here.
tycho-compiler-plugin/src/main/java/org/eclipse/tycho/compiler/AbstractOsgiCompilerMojo.java
Show resolved
Hide resolved
...tadata-model/src/main/java/org/eclipse/tycho/model/classpath/SourceFolderClasspathEntry.java
Outdated
Show resolved
Hide resolved
tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java
Outdated
Show resolved
Hide resolved
All review comments have been addressed in commit 866687c. The changes include:
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
866687c to
8ae7d26
Compare
8ae7d26 to
3102a55
Compare
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
Implements support for Eclipse JDT's
releaseclasspath attribute (introduced in Eclipse 4.38) to enable multi-release JAR compilation with flexible source folder naming and without requiring supplemental manifests.Changes
Core Implementation
SourceFolderClasspathEntry: AddedgetMultiReleaseVersion()method returningOptionalIntto extract Java version fromreleaseclasspath attributeAbstractOsgiCompilerMojo: EnhanceddoCompile()to check forMulti-Release: truemanifest header first, then detect classpath entries withreleaseattributes, compile them with appropriate--releaseflags, and output toMETA-INF/versions/N/directories. Falls back to directory-based approach for backward compatibility.Multi-Release: trueheader must be explicitly set in the manifest as a prerequisite to enable the featureExample
.classpathfile marking source folders for specific Java versions:Note: Source folders can be named flexibly (e.g.,
src_java9,java11-src). The version is determined by thereleaseattribute value, not the folder name.Required manifest configuration:
Resulting JAR structure:
Key Features
Multi-Release: trueheader is required as the primary triggerreleaseattributeMETA-INF/versions/N/OSGI-INF/are requiredsrcNnaming) if no classpath attributes foundDemo & Documentation
demo/multi-release-jar-classpath/: Reference implementation using classpath attribute approachBuildingMultiReleaseBundles.md: Comprehensive guide covering JEP 238, OSGi R8 spec, both approaches (classpath vs manifest-first), and best practicesDemoTest: Added integration test for classpath-based demoReferences
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.