mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-18 19:26:39 +08:00
Minor edit.
This commit is contained in:
parent
bf3e45bce6
commit
22551b2bec
8
dist/main/index.js
generated
vendored
8
dist/main/index.js
generated
vendored
@ -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* () {
|
||||
|
@ -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`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user