diff --git a/README.md b/README.md index 5182e362..c174abe3 100644 --- a/README.md +++ b/README.md @@ -103,8 +103,8 @@ Currently, the following distributions are supported: | `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) | | `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq) | `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/) -| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense) | `semeru` | IBM Semeru Runtime Open Edition | [Link](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [Link](https://openjdk.java.net/legal/gplv2+ce.html) | +| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense) **NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions. diff --git a/__tests__/distributors/semeru-installer.test.ts b/__tests__/distributors/semeru-installer.test.ts index 208243bd..97f25cc8 100644 --- a/__tests__/distributors/semeru-installer.test.ts +++ b/__tests__/distributors/semeru-installer.test.ts @@ -82,12 +82,12 @@ describe('getAvailableVersions', () => { .mockReturnValueOnce({ statusCode: 200, headers: {}, - result: manifestData + result: manifestData as any }) .mockReturnValueOnce({ statusCode: 200, headers: {}, - result: manifestData + result: manifestData as any }) .mockReturnValueOnce({ statusCode: 200, diff --git a/dist/setup/index.js b/dist/setup/index.js index c2a40ccf..2d095d42 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -104316,9 +104316,9 @@ const installer_3 = __nccwpck_require__(8766); const installer_4 = __nccwpck_require__(8579); const installer_5 = __nccwpck_require__(883); const installer_6 = __nccwpck_require__(3613); -const installer_7 = __nccwpck_require__(4750); -const installer_8 = __nccwpck_require__(4298); -const installer_9 = __nccwpck_require__(1121); +const installer_7 = __nccwpck_require__(1121); +const installer_8 = __nccwpck_require__(4750); +const installer_9 = __nccwpck_require__(4298); var JavaDistribution; (function (JavaDistribution) { JavaDistribution["Adopt"] = "adopt"; @@ -104351,11 +104351,11 @@ function getJavaDistribution(distributionName, installerOptions, jdkFile) { case JavaDistribution.Microsoft: return new installer_6.MicrosoftDistributions(installerOptions); case JavaDistribution.Semeru: - return new installer_9.SemeruDistribution(installerOptions); + return new installer_7.SemeruDistribution(installerOptions); case JavaDistribution.Corretto: - return new installer_7.CorrettoDistribution(installerOptions); + return new installer_8.CorrettoDistribution(installerOptions); case JavaDistribution.Oracle: - return new installer_8.OracleDistribution(installerOptions); + return new installer_9.OracleDistribution(installerOptions); default: return null; } @@ -105022,7 +105022,9 @@ class SemeruDistribution extends base_installer_1.JavaBase { const imageType = this.packageType; const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const releaseType = this.stable ? 'ga' : 'ea'; - console.time('semeru-retrieve-available-versions'); // eslint-disable-line no-console + if (core.isDebug()) { + console.time('Retrieving available versions for Semeru took'); // eslint-disable-line no-console + } const baseRequestArguments = [ `project=jdk`, 'vendor=ibm', @@ -105046,17 +105048,7 @@ class SemeruDistribution extends base_installer_1.JavaBase { // url is identical except page_index so print it once for debug core.debug(`Gathering available versions from '${availableVersionsUrl}'`); } - if (core.isDebug()) { - core.debug('Semeru distribution version URL: ' + availableVersionsUrl); - } - let iTypedResponse = null; - try { - iTypedResponse = yield this.http.getJson(availableVersionsUrl); - } - catch (element) { - console.log('error', element); // eslint-disable-line no-console - } - const paginationPage = iTypedResponse.result; + const paginationPage = (yield this.http.getJson(availableVersionsUrl)).result; if (paginationPage === null || paginationPage.length === 0) { // break infinity loop because we have reached end of pagination break; @@ -105065,18 +105057,17 @@ class SemeruDistribution extends base_installer_1.JavaBase { page_index++; } if (core.isDebug()) { - core.startGroup('Print information about available IBM Semeru versions'); - console.timeEnd('semeru-retrieve-available-versions'); // eslint-disable-line no-console + core.startGroup('Print information about available versions'); + console.timeEnd('Retrieving available versions for Semeru took'); // eslint-disable-line no-console core.debug(`Available versions: [${availableVersions.length}]`); core.debug(availableVersions.map(item => item.version_data.semver).join(', ')); - core.debug(JSON.stringify(availableVersions)); core.endGroup(); } return availableVersions; }); } getPlatformOption() { - // Adoptium has own platform names so need to map them + // Adopt has own platform names so need to map them switch (process.platform) { case 'darwin': return 'mac'; diff --git a/src/distributions/distribution-factory.ts b/src/distributions/distribution-factory.ts index d3af6685..1dd5131a 100644 --- a/src/distributions/distribution-factory.ts +++ b/src/distributions/distribution-factory.ts @@ -6,9 +6,9 @@ import {AdoptDistribution, AdoptImplementation} from './adopt/installer'; import {TemurinDistribution, TemurinImplementation} from './temurin/installer'; import {LibericaDistributions} from './liberica/installer'; import {MicrosoftDistributions} from './microsoft/installer'; +import {SemeruDistribution} from './semeru/installer'; import {CorrettoDistribution} from './corretto/installer'; import {OracleDistribution} from './oracle/installer'; -import {SemeruDistribution} from './semeru/installer'; enum JavaDistribution { Adopt = 'adopt', diff --git a/src/distributions/semeru/installer.ts b/src/distributions/semeru/installer.ts index 80f84ad4..c4075261 100644 --- a/src/distributions/semeru/installer.ts +++ b/src/distributions/semeru/installer.ts @@ -129,7 +129,9 @@ export class SemeruDistribution extends JavaBase { const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions const releaseType = this.stable ? 'ga' : 'ea'; - console.time('semeru-retrieve-available-versions'); // eslint-disable-line no-console + if (core.isDebug()) { + console.time('Retrieving available versions for Semeru took'); // eslint-disable-line no-console + } const baseRequestArguments = [ `project=jdk`, @@ -158,20 +160,11 @@ export class SemeruDistribution extends JavaBase { ); } - if (core.isDebug()) { - core.debug('Semeru distribution version URL: ' + availableVersionsUrl); - } - - let iTypedResponse = null; - try { - iTypedResponse = await this.http.getJson( + const paginationPage = ( + await this.http.getJson( availableVersionsUrl - ); - } catch (element) { - console.log('error', element); // eslint-disable-line no-console - } - - const paginationPage = iTypedResponse!.result; + ) + ).result; if (paginationPage === null || paginationPage.length === 0) { // break infinity loop because we have reached end of pagination break; @@ -182,13 +175,12 @@ export class SemeruDistribution extends JavaBase { } if (core.isDebug()) { - core.startGroup('Print information about available IBM Semeru versions'); - console.timeEnd('semeru-retrieve-available-versions'); // eslint-disable-line no-console + core.startGroup('Print information about available versions'); + console.timeEnd('Retrieving available versions for Semeru took'); // eslint-disable-line no-console core.debug(`Available versions: [${availableVersions.length}]`); core.debug( availableVersions.map(item => item.version_data.semver).join(', ') ); - core.debug(JSON.stringify(availableVersions)); core.endGroup(); } @@ -196,7 +188,7 @@ export class SemeruDistribution extends JavaBase { } private getPlatformOption(): string { - // Adoptium has own platform names so need to map them + // Adopt has own platform names so need to map them switch (process.platform) { case 'darwin': return 'mac';