Fix build scripts and HoverTest for Java 21#20
Open
melsiir wants to merge 1 commit intoidelice:masterfrom
Open
Fix build scripts and HoverTest for Java 21#20melsiir wants to merge 1 commit intoidelice:masterfrom
melsiir wants to merge 1 commit intoidelice:masterfrom
Conversation
Owner
|
please rebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
1. HoverTest.java fixes
Issue: contents is typed as Object in recent LSP4J versions, so the for-each loop and h.value fail to compile.
2. build.sh improvements
The old build script blindly download jdk for every os so I made changes to only download for the current os only if necessary
Detect system Java:
If $JAVA_HOME exists and Java ≥ 21 → skip all JDK downloads
Otherwise → download only the JDK for the current OS
Run only the OS-specific link script (Linux/macOS/Windows) instead of all three.
3. link scripts (link_linux.sh, link_mac.sh)
Detect and use $JAVA_HOME if Java ≥ 21
Fallback to downloaded JDK for the OS if system Java is missing or too old
Normalize jlink paths so scripts work consistently across environments
Benefits
Hover tests compile successfully with modern LSP4J
Builds are faster and OS-aware, avoiding unnecessary downloads
Reduces network usage and avoids running irrelevant link scripts
Maintains compatibility across Linux, macOS, and Windows