mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 01:46:46 +00:00
Move distributionArchitecture method to base class
They are mostly all the same, and this can still be overridden when needed
This commit is contained in:
parent
46869be4a8
commit
f21b8ec265
2 changed files with 17 additions and 15 deletions
|
@ -151,6 +151,22 @@ export abstract class JavaBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected distributionArchitecture(): string {
|
protected distributionArchitecture(): string {
|
||||||
return this.architecture;
|
// default mappings of config architectures to distribution architectures
|
||||||
|
// override if a distribution uses any different names; see liberica for an example
|
||||||
|
|
||||||
|
// node's os.arch() - which this defaults to - can return any of:
|
||||||
|
// 'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', and 'x64'
|
||||||
|
// so we need to map these to java distribution architectures
|
||||||
|
// 'amd64' is included here too b/c it's a common alias for 'x64' people might use explicitly
|
||||||
|
switch (this.architecture) {
|
||||||
|
case 'amd64':
|
||||||
|
return 'x64';
|
||||||
|
case 'ia32':
|
||||||
|
return 'x86';
|
||||||
|
case 'arm64':
|
||||||
|
return 'aarch64';
|
||||||
|
default:
|
||||||
|
return this.architecture;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,18 +152,4 @@ export class TemurinDistribution extends JavaBase {
|
||||||
return process.platform;
|
return process.platform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected distributionArchitecture(): string {
|
|
||||||
// Temurin has own architecture names so need to map them
|
|
||||||
switch (this.architecture) {
|
|
||||||
case 'amd64':
|
|
||||||
return 'x64';
|
|
||||||
case 'ia32':
|
|
||||||
return 'x32';
|
|
||||||
case 'arm64':
|
|
||||||
return 'aarch64';
|
|
||||||
default:
|
|
||||||
return this.architecture;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue