From f00190299c3eeec3d21385b9dac1e0d061d7325e Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Tue, 13 Feb 2024 15:53:32 +0100 Subject: [PATCH] Use semantic version only for tool name. --- dist/main/index.js | 14 +++++++------- src/graalvm.ts | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index b6a5550..29d11ae 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -93861,7 +93861,7 @@ function setUpGraalVMJDK(javaVersionOrDev) { return setUpGraalVMJDKDevBuild(); } const javaVersion = javaVersionOrDev; - let toolName = determineToolName(javaVersion, false); + let toolName = determineToolName((0, utils_1.toSemVer)(javaVersion), false); let downloadUrl; if (javaVersion.includes('.')) { if (semver.valid(javaVersion)) { @@ -93869,11 +93869,11 @@ function setUpGraalVMJDK(javaVersionOrDev) { const minorJavaVersion = semver.minor(javaVersion); const patchJavaVersion = semver.patch(javaVersion); const isGARelease = minorJavaVersion === 0 && patchJavaVersion === 0; - let downloadName = toolName; - if (isGARelease) { - // For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/) - downloadName = determineToolName(majorJavaVersion.toString(), false); - } + // For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/) + const downloadVersion = isGARelease + ? majorJavaVersion.toString() + : javaVersion; + const downloadName = determineToolName(downloadVersion, false); downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${downloadName}${c.GRAALVM_FILE_EXTENSION}`; } else { @@ -93945,7 +93945,7 @@ function findLatestGraalVMJDKCEJavaVersion(majorJavaVersion) { } exports.findLatestGraalVMJDKCEJavaVersion = findLatestGraalVMJDKCEJavaVersion; function determineToolName(javaVersion, isCommunity) { - return `graalvm${isCommunity ? '-community' : ''}-jdk-${(0, utils_1.toSemVer)(javaVersion)}_${c.JDK_PLATFORM}-${c.JDK_ARCH}_bin`; + return `graalvm${isCommunity ? '-community' : ''}-jdk-${javaVersion}_${c.JDK_PLATFORM}-${c.JDK_ARCH}_bin`; } function downloadGraalVMJDK(downloadUrl, javaVersion) { return __awaiter(this, void 0, void 0, function* () { diff --git a/src/graalvm.ts b/src/graalvm.ts index 2b12414..9875046 100644 --- a/src/graalvm.ts +++ b/src/graalvm.ts @@ -29,7 +29,7 @@ export async function setUpGraalVMJDK( return setUpGraalVMJDKDevBuild() } const javaVersion = javaVersionOrDev - let toolName = determineToolName(javaVersion, false) + let toolName = determineToolName(toSemVer(javaVersion), false) let downloadUrl: string if (javaVersion.includes('.')) { if (semver.valid(javaVersion)) { @@ -37,11 +37,11 @@ export async function setUpGraalVMJDK( const minorJavaVersion = semver.minor(javaVersion) const patchJavaVersion = semver.patch(javaVersion) const isGARelease = minorJavaVersion === 0 && patchJavaVersion === 0 - let downloadName = toolName - if (isGARelease) { - // For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/) - downloadName = determineToolName(majorJavaVersion.toString(), false) - } + // For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/) + const downloadVersion = isGARelease + ? majorJavaVersion.toString() + : javaVersion + const downloadName = determineToolName(downloadVersion, false) downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${downloadName}${c.GRAALVM_FILE_EXTENSION}` } else { throw new Error( @@ -126,7 +126,7 @@ export async function findLatestGraalVMJDKCEJavaVersion( } function determineToolName(javaVersion: string, isCommunity: boolean) { - return `graalvm${isCommunity ? '-community' : ''}-jdk-${toSemVer(javaVersion)}_${ + return `graalvm${isCommunity ? '-community' : ''}-jdk-${javaVersion}_${ c.JDK_PLATFORM }-${c.JDK_ARCH}_bin` }