Minor edit.

This commit is contained in:
Fabio Niephaus 2024-02-13 17:16:15 +01:00
parent bf3e45bce6
commit 22551b2bec
No known key found for this signature in database
GPG Key ID: F21CF5275F31DFD6
2 changed files with 8 additions and 8 deletions

8
dist/main/index.js generated vendored
View File

@ -93861,7 +93861,8 @@ function setUpGraalVMJDK(javaVersionOrDev) {
return setUpGraalVMJDKDevBuild();
}
const javaVersion = javaVersionOrDev;
let toolName = determineToolName(javaVersion, false);
const toolName = determineToolName(javaVersion, false);
let downloadName = toolName;
let downloadUrl;
if (javaVersion.includes('.')) {
if (semver.valid(javaVersion)) {
@ -93869,7 +93870,6 @@ 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);
@ -93884,7 +93884,7 @@ function setUpGraalVMJDK(javaVersionOrDev) {
downloadUrl = yield findLatestEABuildDownloadUrl(javaVersion);
}
else {
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${toolName}${c.GRAALVM_FILE_EXTENSION}`;
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${downloadName}${c.GRAALVM_FILE_EXTENSION}`;
}
const downloader = () => __awaiter(this, void 0, void 0, function* () { return downloadGraalVMJDK(downloadUrl, javaVersion); });
return (0, utils_1.downloadExtractAndCacheJDK)(downloader, toolName, javaVersion);
@ -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* () {

View File

@ -29,7 +29,8 @@ export async function setUpGraalVMJDK(
return setUpGraalVMJDKDevBuild()
}
const javaVersion = javaVersionOrDev
let toolName = determineToolName(javaVersion, false)
const toolName = determineToolName(javaVersion, false)
let downloadName = toolName
let downloadUrl: string
if (javaVersion.includes('.')) {
if (semver.valid(javaVersion)) {
@ -37,7 +38,6 @@ 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)
@ -51,7 +51,7 @@ export async function setUpGraalVMJDK(
} else if (javaVersion === '22-ea') {
downloadUrl = await findLatestEABuildDownloadUrl(javaVersion)
} else {
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${toolName}${c.GRAALVM_FILE_EXTENSION}`
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${downloadName}${c.GRAALVM_FILE_EXTENSION}`
}
const downloader = async () => downloadGraalVMJDK(downloadUrl, javaVersion)
return downloadExtractAndCacheJDK(downloader, toolName, javaVersion)
@ -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`
}