diff --git a/__tests__/distributors/liberica-installer.test.ts b/__tests__/distributors/liberica-installer.test.ts index 0b209af9..1044e7f4 100644 --- a/__tests__/distributors/liberica-installer.test.ts +++ b/__tests__/distributors/liberica-installer.test.ts @@ -25,27 +25,27 @@ describe('getAvailableVersions', () => { it.each([ [ { version: '11.x', architecture: 'x86', packageType: 'jdk', checkLatest: false }, - 'bundle-type=jdk&fx=false&bitness=32&arch=x86&build-type=all' + 'bundle-type=jdk&bitness=32&arch=x86&build-type=all' ], [ { version: '11-ea', architecture: 'x86', packageType: 'jdk', checkLatest: false }, - 'bundle-type=jdk&fx=false&bitness=32&arch=x86&build-type=ea' + 'bundle-type=jdk&bitness=32&arch=x86&build-type=ea' ], [ { version: '16.0.2', architecture: 'x64', packageType: 'jdk', checkLatest: false }, - 'bundle-type=jdk&fx=false&bitness=64&arch=x86&build-type=all' + 'bundle-type=jdk&bitness=64&arch=x86&build-type=all' ], [ { version: '16.0.2', architecture: 'x64', packageType: 'jre', checkLatest: false }, - 'bundle-type=jre&fx=false&bitness=64&arch=x86&build-type=all' + 'bundle-type=jre&bitness=64&arch=x86&build-type=all' ], [ { version: '8', architecture: 'armv7', packageType: 'jdk+fx', checkLatest: false }, - 'bundle-type=jdk&fx=true&bitness=32&arch=arm&build-type=all' + 'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all' ], [ { version: '8', architecture: 'aarch64', packageType: 'jre+fx', checkLatest: false }, - 'bundle-type=jre&fx=true&bitness=64&arch=arm&build-type=all' + 'bundle-type=jre-full&bitness=64&arch=arm&build-type=all' ] ])('build correct url for %s -> %s', async (input, urlParams) => { const additionalParams = diff --git a/dist/setup/index.js b/dist/setup/index.js index 734c5af5..fea18443 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -38655,12 +38655,17 @@ class LibericaDistributions extends base_installer_1.JavaBase { }); } prepareAvailableVersionsUrl() { - var _a, _b; - const [bundleType, feature] = this.packageType.split('+'); - const urlOptions = Object.assign(Object.assign({ os: this.getPlatformOption(), 'bundle-type': bundleType, fx: (_b = (_a = feature === null || feature === void 0 ? void 0 : feature.includes('fx')) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : 'false' }, this.getArchitectureOptions()), { 'build-type': this.stable ? 'all' : 'ea', 'installation-type': 'archive', fields: 'downloadUrl,version,featureVersion,interimVersion,updateVersion,buildVersion' }); + const urlOptions = Object.assign(Object.assign({ os: this.getPlatformOption(), 'bundle-type': this.getBundleType() }, this.getArchitectureOptions()), { 'build-type': this.stable ? 'all' : 'ea', 'installation-type': 'archive', fields: 'downloadUrl,version,featureVersion,interimVersion,updateVersion,buildVersion' }); const searchParams = new URLSearchParams(urlOptions).toString(); return `https://api.bell-sw.com/v1/liberica/releases?${searchParams}`; } + getBundleType() { + const [bundleType, feature] = this.packageType.split('+'); + if (feature === null || feature === void 0 ? void 0 : feature.includes('fx')) { + return bundleType + '-full'; + } + return bundleType; + } getArchitectureOptions() { switch (this.architecture) { case 'x86': diff --git a/src/distributions/liberica/installer.ts b/src/distributions/liberica/installer.ts index ab7bfc63..d4b32add 100644 --- a/src/distributions/liberica/installer.ts +++ b/src/distributions/liberica/installer.ts @@ -87,12 +87,9 @@ export class LibericaDistributions extends JavaBase { } private prepareAvailableVersionsUrl() { - const [bundleType, feature] = this.packageType.split('+'); - const urlOptions = { os: this.getPlatformOption(), - 'bundle-type': bundleType, - fx: feature?.includes('fx')?.toString() ?? 'false', + 'bundle-type': this.getBundleType(), ...this.getArchitectureOptions(), 'build-type': this.stable ? 'all' : 'ea', 'installation-type': 'archive', @@ -104,6 +101,14 @@ export class LibericaDistributions extends JavaBase { return `https://api.bell-sw.com/v1/liberica/releases?${searchParams}`; } + private getBundleType(): string { + const [bundleType, feature] = this.packageType.split('+'); + if (feature?.includes('fx')) { + return bundleType + '-full'; + } + return bundleType; + } + private getArchitectureOptions(): ArchitectureOptions { switch (this.architecture) { case 'x86':