From 18d1e833327c11360fda80d8db740c0904214d2a Mon Sep 17 00:00:00 2001 From: George Adams Date: Wed, 16 Mar 2022 15:33:25 +0100 Subject: [PATCH] switch to static URLs --- dist/setup/index.js | 10 ++++------ src/distributions/microsoft/installer.ts | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index e3f778fd..bf5171ea 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -13895,7 +13895,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { const availableVersionsRaw = yield this.getAvailableVersions(); const opts = this.getPlatformOption(); const availableVersions = availableVersionsRaw.map(item => ({ - url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version.join('.')}-${opts.os}-${this.architecture}.${opts.archive}`, + url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version}-${opts.os}-${this.architecture}.${opts.archive}`, version: this.convertVersionToSemver(item) })); const satisfiedVersion = availableVersions @@ -13913,20 +13913,18 @@ class MicrosoftDistributions extends base_installer_1.JavaBase { } getAvailableVersions() { return __awaiter(this, void 0, void 0, function* () { - // TODO get these dynamically! - // We will need Microsoft to add an endpoint where we can query for versions. const jdkVersions = [ { - version: [17, 0, 2, 8, 1] + version: [17] }, { - version: [16, 0, 2, 7, 1] + version: [16] } ]; // M1 is only supported for Java 16 & 17 if (process.platform !== 'darwin' || this.architecture !== 'aarch64') { jdkVersions.push({ - version: [11, 0, 14, 1, 1] + version: [11] }); } return jdkVersions; diff --git a/src/distributions/microsoft/installer.ts b/src/distributions/microsoft/installer.ts index 7cf9401f..3a494965 100644 --- a/src/distributions/microsoft/installer.ts +++ b/src/distributions/microsoft/installer.ts @@ -53,7 +53,7 @@ export class MicrosoftDistributions extends JavaBase { const opts = this.getPlatformOption(); const availableVersions = availableVersionsRaw.map(item => ({ - url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version.join('.')}-${opts.os}-${ + url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version}-${opts.os}-${ this.architecture }.${opts.archive}`, version: this.convertVersionToSemver(item) @@ -77,21 +77,19 @@ export class MicrosoftDistributions extends JavaBase { } private async getAvailableVersions(): Promise { - // TODO get these dynamically! - // We will need Microsoft to add an endpoint where we can query for versions. const jdkVersions = [ { - version: [17, 0, 2, 8, 1] + version: [17] }, { - version: [16, 0, 2, 7, 1] + version: [16] } ]; // M1 is only supported for Java 16 & 17 if (process.platform !== 'darwin' || this.architecture !== 'aarch64') { jdkVersions.push({ - version: [11, 0, 14, 1, 1] + version: [11] }); }