mirror of
https://github.com/actions/setup-java.git
synced 2025-06-30 04:54:14 +00:00
Fixed adopt toolchain folder
This commit is contained in:
parent
753715716d
commit
41f7318506
3 changed files with 25 additions and 7 deletions
|
@ -110,6 +110,24 @@ describe('getAvailableVersions', () => {
|
|||
expect(availableVersions).not.toBeNull();
|
||||
expect(availableVersions.length).toBe(manifestData.length * 2);
|
||||
});
|
||||
|
||||
it.each([
|
||||
[AdoptImplementation.Hotspot, 'jdk', 'Java_Adopt_jdk'],
|
||||
[AdoptImplementation.Hotspot, 'jre', 'Java_Adopt_jre'],
|
||||
[AdoptImplementation.OpenJ9, 'jdk', 'Java_Adopt-OpenJ9_jdk'],
|
||||
[AdoptImplementation.OpenJ9, 'jre', 'Java_Adopt-OpenJ9_jre']
|
||||
])(
|
||||
'find right toolchain folder',
|
||||
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
||||
const distribution = new AdoptDistribution(
|
||||
{ version: '11', architecture: 'x64', packageType: packageType, checkLatest: false },
|
||||
impl
|
||||
);
|
||||
|
||||
// @ts-ignore - because it is protected
|
||||
expect(distribution.toolcacheFolderName).toBe(expected);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
|
|
4
dist/setup/index.js
vendored
4
dist/setup/index.js
vendored
|
@ -26910,7 +26910,7 @@ var AdoptImplementation;
|
|||
class AdoptDistribution extends base_installer_1.JavaBase {
|
||||
constructor(installerOptions, jvmImpl) {
|
||||
super(`Adopt-${jvmImpl}`, installerOptions);
|
||||
this.jvmImpl = jvmImpl.toLowerCase();
|
||||
this.jvmImpl = jvmImpl;
|
||||
}
|
||||
findPackageForDownload(version) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
|
@ -26981,7 +26981,7 @@ class AdoptDistribution extends base_installer_1.JavaBase {
|
|||
`architecture=${arch}`,
|
||||
`image_type=${imageType}`,
|
||||
`release_type=${releaseType}`,
|
||||
`jvm_impl=${this.jvmImpl}`
|
||||
`jvm_impl=${this.jvmImpl.toLowerCase()}`
|
||||
].join('&');
|
||||
// need to iterate through all pages to retrieve the list of all versions
|
||||
// Adopt API doesn't provide way to retrieve the count of pages to iterate so infinity loop
|
||||
|
|
|
@ -16,11 +16,11 @@ export enum AdoptImplementation {
|
|||
}
|
||||
|
||||
export class AdoptDistribution extends JavaBase {
|
||||
private jvmImpl: string;
|
||||
|
||||
constructor(installerOptions: JavaInstallerOptions, jvmImpl: AdoptImplementation) {
|
||||
constructor(
|
||||
installerOptions: JavaInstallerOptions,
|
||||
private readonly jvmImpl: AdoptImplementation
|
||||
) {
|
||||
super(`Adopt-${jvmImpl}`, installerOptions);
|
||||
this.jvmImpl = jvmImpl.toLowerCase();
|
||||
}
|
||||
|
||||
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||
|
@ -105,7 +105,7 @@ export class AdoptDistribution extends JavaBase {
|
|||
`architecture=${arch}`,
|
||||
`image_type=${imageType}`,
|
||||
`release_type=${releaseType}`,
|
||||
`jvm_impl=${this.jvmImpl}`
|
||||
`jvm_impl=${this.jvmImpl.toLowerCase()}`
|
||||
].join('&');
|
||||
|
||||
// need to iterate through all pages to retrieve the list of all versions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue