mirror of
https://github.com/actions/setup-java.git
synced 2025-04-21 02:16:45 +00:00
Add support for multiple jdks (#368)
This commit is contained in:
parent
749e4491fa
commit
d854b6da19
15 changed files with 4219 additions and 3569 deletions
|
@ -93,7 +93,9 @@ export class AdoptDistribution extends JavaBase {
|
|||
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
|
||||
const releaseType = this.stable ? 'ga' : 'ea';
|
||||
|
||||
console.time('adopt-retrieve-available-versions');
|
||||
if (core.isDebug()) {
|
||||
console.time('adopt-retrieve-available-versions');
|
||||
}
|
||||
|
||||
const baseRequestArguments = [
|
||||
`project=jdk`,
|
||||
|
|
|
@ -142,10 +142,12 @@ export abstract class JavaBase {
|
|||
}
|
||||
|
||||
protected setJavaDefault(version: string, toolPath: string) {
|
||||
const majorVerssion = version.split('.')[0];
|
||||
core.exportVariable('JAVA_HOME', toolPath);
|
||||
core.addPath(path.join(toolPath, 'bin'));
|
||||
core.setOutput('distribution', this.distribution);
|
||||
core.setOutput('path', toolPath);
|
||||
core.setOutput('version', version);
|
||||
core.exportVariable(`JAVA_HOME_${majorVerssion}_${this.architecture.toUpperCase()}`, toolPath);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,9 @@ export class CorrettoDistribution extends JavaBase {
|
|||
const arch = this.architecture;
|
||||
const imageType = this.packageType;
|
||||
|
||||
console.time('coretto-retrieve-available-versions');
|
||||
if (core.isDebug()) {
|
||||
console.time('coretto-retrieve-available-versions');
|
||||
}
|
||||
|
||||
const availableVersionsUrl =
|
||||
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
|
||||
|
|
|
@ -66,7 +66,9 @@ export class LibericaDistributions extends JavaBase {
|
|||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<LibericaVersion[]> {
|
||||
console.time('liberica-retrieve-available-versions');
|
||||
if (core.isDebug()) {
|
||||
console.time('liberica-retrieve-available-versions');
|
||||
}
|
||||
const url = this.prepareAvailableVersionsUrl();
|
||||
|
||||
if (core.isDebug()) {
|
||||
|
|
|
@ -91,7 +91,9 @@ export class TemurinDistribution extends JavaBase {
|
|||
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
|
||||
const releaseType = this.stable ? 'ga' : 'ea';
|
||||
|
||||
console.time('temurin-retrieve-available-versions');
|
||||
if (core.isDebug()) {
|
||||
console.time('temurin-retrieve-available-versions');
|
||||
}
|
||||
|
||||
const baseRequestArguments = [
|
||||
`project=jdk`,
|
||||
|
|
|
@ -90,7 +90,9 @@ export class ZuluDistribution extends JavaBase {
|
|||
const javafx = features?.includes('fx') ?? false;
|
||||
const releaseStatus = this.stable ? 'ga' : 'ea';
|
||||
|
||||
console.time('azul-retrieve-available-versions');
|
||||
if (core.isDebug()) {
|
||||
console.time('azul-retrieve-available-versions');
|
||||
}
|
||||
const requestArguments = [
|
||||
`os=${platform}`,
|
||||
`ext=${extension}`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue