mirror of
https://github.com/actions/setup-java.git
synced 2026-06-16 16:38:50 +00:00
Fixes from review
This commit is contained in:
parent
d8f95befc8
commit
b8110ecdf3
9
dist/setup/index.js
vendored
9
dist/setup/index.js
vendored
@ -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* () {
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user