Skip to content

feat: added Mac JDK provider#105

Merged
quintesse merged 1 commit into
mainfrom
mac_provider
May 26, 2026
Merged

feat: added Mac JDK provider#105
quintesse merged 1 commit into
mainfrom
mac_provider

Conversation

@quintesse
Copy link
Copy Markdown
Contributor

@quintesse quintesse commented May 26, 2026

Summary by CodeRabbit

  • New Features
    • Added macOS JDK auto-discovery that automatically detects and catalogs installed JDK bundles on macOS systems. The discovery intelligently filters valid JDK installations from JRE-only bundles and generates stable identifiers for consistent multi-version JDK management.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f3e0f7c-0b47-4a6b-b578-9b6ee9d7e314

📥 Commits

Reviewing files that changed from the base of the PR and between 6b55f28 and 89b9b4a.

📒 Files selected for processing (4)
  • src/main/java/dev/jbang/devkitman/jdkproviders/MacJdkProvider.java
  • src/main/resources/META-INF/services/dev.jbang.devkitman.JdkDiscovery
  • src/test/java/dev/jbang/devkitman/TestJdkProviders.java
  • src/test/java/dev/jbang/devkitman/jdkproviders/MacJdkProviderTest.java

📝 Walkthrough

Walkthrough

This PR adds macOS JDK discovery by introducing MacJdkProvider, which enumerates JDK installations under /Library/Java/JavaVirtualMachines, filters bundles by resolving their Contents/Home paths and excluding symlinks, derives stable IDs from bundle names, and integrates via the JdkDiscovery service provider interface.

Changes

macOS JDK Discovery

Layer / File(s) Summary
macOS JDK Provider Implementation
src/main/java/dev/jbang/devkitman/jdkproviders/MacJdkProvider.java
MacJdkProvider extends BaseFoldersJdkProvider with macOS root path (/Library/Java/JavaVirtualMachines), platform gating in canUse(), directory enumeration that resolves bundle Contents/Home paths and excludes symlinks via acceptFolder(), and bidirectional JDK ID mapping that derives IDs from bundle names (stripping .jdk suffix) and resolves IDs back to bundle home paths. Inner Discovery class implements JdkDiscovery with provider identity "mac".
Service Registration and Integration Updates
src/main/resources/META-INF/services/dev.jbang.devkitman.JdkDiscovery, src/test/java/dev/jbang/devkitman/TestJdkProviders.java
MacJdkProvider$Discovery is registered as a service provider. Integration test expectations updated to include "mac" in provider names and MacJdkProvider instances in the all-providers collection.
Functional Test Coverage
src/test/java/dev/jbang/devkitman/jdkproviders/MacJdkProviderTest.java
Test suite with mock macOS JDK/JRE bundle structures validates correct enumeration of JDK bundles, filtering of JRE-only bundles (identified by absence of javac), and stable ID derivation from dotted bundle names.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • jbangdev/jbang-devkitman#104: Base folder-acceptance logic refactor that this macOS provider implementation depends on for symlink filtering.

Poem

🐰 A macOS JDK provider hops into the fold,
Finding bundles in Virtual Machines, stories untold,
No symlinks allowed, just the real JDK gold,
Each bundle named true, IDs steady and bold!
thump thump 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: adding macOS JDK provider support with the MacJdkProvider class.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mac_provider

Comment @coderabbitai help to get the list of available commands and usage tips.

@quintesse quintesse merged commit e98a086 into main May 26, 2026
4 checks passed
@quintesse quintesse deleted the mac_provider branch May 26, 2026 17:06
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.

1 participant