From a7d1de667661f99a6a12b233b38e9549235361fe Mon Sep 17 00:00:00 2001 From: Bruno Borges Date: Tue, 7 Jul 2026 14:32:36 -0400 Subject: [PATCH] Add Tencent Kona SDKMAN mapping and format sdkmanrc docs as a table - Map SDKMAN 'kona' identifier to the 'kona' distribution (added in #672) - Add a .sdkmanrc test case for the kona suffix - Convert the inline SDKMAN suffix mapping in advanced-usage.md to a table - Rebuild dist bundles Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- __tests__/util.test.ts | 3 ++- dist/cleanup/index.js | 3 ++- dist/setup/index.js | 3 ++- docs/advanced-usage.md | 19 ++++++++++++++++++- src/util.ts | 3 ++- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/__tests__/util.test.ts b/__tests__/util.test.ts index 48f598d4..6782e687 100644 --- a/__tests__/util.test.ts +++ b/__tests__/util.test.ts @@ -183,7 +183,8 @@ describe('getVersionFromFileContent', () => { ['java=11.0.25-sapmchn', '11.0.25', 'sapmachine'], ['java=21.0.5-jbr', '21.0.5', 'jetbrains'], ['java=11.0.25-sem', '11.0.25', 'semeru'], - ['java=17.0.13-dragonwell', '17.0.13', 'dragonwell'] + ['java=17.0.13-dragonwell', '17.0.13', 'dragonwell'], + ['java=21.0.5-kona', '21.0.5', 'kona'] ])( 'parsing %s should return version %s and distribution %s', (content: string, expectedVersion: string, expectedDist: string) => { diff --git a/dist/cleanup/index.js b/dist/cleanup/index.js index 1a165c30..c8138b58 100644 --- a/dist/cleanup/index.js +++ b/dist/cleanup/index.js @@ -52578,7 +52578,8 @@ function mapSdkmanDistribution(sdkmanDist) { oracle: 'oracle', sapmchn: 'sapmachine', jbr: 'jetbrains', - dragonwell: 'dragonwell' + dragonwell: 'dragonwell', + kona: 'kona' }; const mapped = distributionMap[sdkmanDist.toLowerCase()]; if (!mapped) { diff --git a/dist/setup/index.js b/dist/setup/index.js index 4b710b8c..819723ad 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -81547,7 +81547,8 @@ function mapSdkmanDistribution(sdkmanDist) { oracle: 'oracle', sapmchn: 'sapmachine', jbr: 'jetbrains', - dragonwell: 'dragonwell' + dragonwell: 'dragonwell', + kona: 'kona' }; const mapped = distributionMap[sdkmanDist.toLowerCase()]; if (!mapped) { diff --git a/docs/advanced-usage.md b/docs/advanced-usage.md index 9e97861d..e494f61c 100644 --- a/docs/advanced-usage.md +++ b/docs/advanced-usage.md @@ -666,7 +666,24 @@ steps: Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`. * In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv). * In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)). - * In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., `java=17.0.7-tem`). When a recognized SDKMAN distribution suffix is present, setup-java can infer the `distribution` input automatically. Supported suffix mappings are: `tem` -> `temurin`, `sem` -> `semeru`, `albba`/`dragonwell` -> `dragonwell`, `zulu` -> `zulu`, `amzn` -> `corretto`, `graal`/`graalce` -> `graalvm`, `librca` -> `liberica`, `ms` -> `microsoft`, `oracle` -> `oracle`, `sapmchn` -> `sapmachine`, `jbr` -> `jetbrains`. Unrecognized suffixes require setting `distribution` explicitly. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information. + * In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., `java=17.0.7-tem`). When a recognized SDKMAN distribution suffix is present, setup-java can infer the `distribution` input automatically. Unrecognized suffixes require setting `distribution` explicitly. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information. + + Supported SDKMAN suffix mappings: + + | SDKMAN suffix | setup-java distribution | + | ------------- | ----------------------- | + | `tem` | `temurin` | + | `sem` | `semeru` | + | `albba`, `dragonwell` | `dragonwell` | + | `zulu` | `zulu` | + | `amzn` | `corretto` | + | `graal`, `graalce` | `graalvm` | + | `librca` | `liberica` | + | `ms` | `microsoft` | + | `oracle` | `oracle` | + | `sapmchn` | `sapmachine` | + | `jbr` | `jetbrains` | + | `kona` | `kona` | If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used. diff --git a/src/util.ts b/src/util.ts index 19bbbf04..32cb6bc1 100644 --- a/src/util.ts +++ b/src/util.ts @@ -222,7 +222,8 @@ function mapSdkmanDistribution(sdkmanDist: string): string | undefined { oracle: 'oracle', sapmchn: 'sapmachine', jbr: 'jetbrains', - dragonwell: 'dragonwell' + dragonwell: 'dragonwell', + kona: 'kona' }; const mapped = distributionMap[sdkmanDist.toLowerCase()];