switch to static URLs

This commit is contained in:
George Adams 2022-03-16 15:33:25 +01:00
parent cd2bc4097e
commit 18d1e83332
No known key found for this signature in database
GPG Key ID: 7B8D7E4421A0916D
2 changed files with 8 additions and 12 deletions

10
dist/setup/index.js vendored
View File

@ -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;

View File

@ -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<MicrosoftVersion[]> {
// 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]
});
}