From 679410561cba18bef4f8836c9c1139cfe70f74a5 Mon Sep 17 00:00:00 2001 From: Aparna Jyothi Date: Mon, 14 Apr 2025 13:18:29 +0530 Subject: [PATCH] fix check-failures for dragonwell --- .github/workflows/e2e-versions.yml | 1 - dist/setup/index.js | 7 ++++--- src/distributions/dragonwell/installer.ts | 11 ++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e-versions.yml b/.github/workflows/e2e-versions.yml index 18ad25c7..3cb15e78 100644 --- a/.github/workflows/e2e-versions.yml +++ b/.github/workflows/e2e-versions.yml @@ -1,4 +1,3 @@ - name: Validate Java e2e on: diff --git a/dist/setup/index.js b/dist/setup/index.js index 5c326176..74d96535 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -130914,9 +130914,10 @@ class DragonwellDistribution extends base_installer_1.JavaBase { } // Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits). // Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools. - if (jdkVersion.split('.').length > 3) { - jdkVersion = util_1.convertVersionToSemver(jdkVersion); - } + const jdkVersionNums = jdkVersion + .replace('+', '.') + .split('.'); + jdkVersion = util_1.convertVersionToSemver(`${jdkVersionNums.slice(0, 3).join('.')}.${jdkVersionNums[jdkVersionNums.length - 1]}`); for (const edition in archMap) { eligibleVersions.push({ os: platform, diff --git a/src/distributions/dragonwell/installer.ts b/src/distributions/dragonwell/installer.ts index 11ed4c25..74d6b1bf 100644 --- a/src/distributions/dragonwell/installer.ts +++ b/src/distributions/dragonwell/installer.ts @@ -149,9 +149,14 @@ export class DragonwellDistribution extends JavaBase { // Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits). // Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools. - if (jdkVersion.split('.').length > 3) { - jdkVersion = convertVersionToSemver(jdkVersion); - } + const jdkVersionNums: string[] = jdkVersion + .replace('+', '.') + .split('.'); + jdkVersion = convertVersionToSemver( + `${jdkVersionNums.slice(0, 3).join('.')}.${ + jdkVersionNums[jdkVersionNums.length - 1] + }` + ); for (const edition in archMap) { eligibleVersions.push({