Fixes from review

This commit is contained in:
John 2026-06-12 12:07:36 +00:00
parent d8f95befc8
commit b8110ecdf3
2 changed files with 15 additions and 15 deletions

9
dist/setup/index.js vendored
View File

@ -77825,16 +77825,15 @@ class AdoptDistribution extends base_installer_1.JavaBase {
constructor(installerOptions, jvmImpl, temurinDistribution = null) {
super(`Adopt-${jvmImpl}`, installerOptions);
this.jvmImpl = jvmImpl;
this.temurinDistribution = temurinDistribution;
if (temurinDistribution !== null &&
jvmImpl !== AdoptImplementation.Hotspot) {
throw new Error('Only Hotspot JVM is supported by Temurin.');
}
// Only use the temurin repo for Hotspot JVMs
if (temurinDistribution === null &&
jvmImpl === AdoptImplementation.Hotspot) {
this.temurinDistribution = new installer_1.TemurinDistribution(installerOptions, installer_1.TemurinImplementation.Hotspot);
}
this.temurinDistribution =
temurinDistribution !== null && temurinDistribution !== void 0 ? temurinDistribution : (jvmImpl === AdoptImplementation.Hotspot
? new installer_1.TemurinDistribution(installerOptions, installer_1.TemurinImplementation.Hotspot)
: null);
}
findPackageForDownload(version) {
return __awaiter(this, void 0, void 0, function* () {

View File

@ -29,10 +29,12 @@ export enum AdoptImplementation {
}
export class AdoptDistribution extends JavaBase {
private readonly temurinDistribution: TemurinDistribution | null;
constructor(
installerOptions: JavaInstallerOptions,
private readonly jvmImpl: AdoptImplementation,
private readonly temurinDistribution: TemurinDistribution | null = null
temurinDistribution: TemurinDistribution | null = null
) {
super(`Adopt-${jvmImpl}`, installerOptions);
@ -44,15 +46,14 @@ export class AdoptDistribution extends JavaBase {
}
// Only use the temurin repo for Hotspot JVMs
if (
temurinDistribution === null &&
jvmImpl === AdoptImplementation.Hotspot
) {
this.temurinDistribution = new TemurinDistribution(
installerOptions,
TemurinImplementation.Hotspot
);
}
this.temurinDistribution =
temurinDistribution ??
(jvmImpl === AdoptImplementation.Hotspot
? new TemurinDistribution(
installerOptions,
TemurinImplementation.Hotspot
)
: null);
}
protected async findPackageForDownload(