mirror of
https://github.com/actions/setup-java.git
synced 2026-07-28 15:14:30 +02:00
Set GRAALVM_HOME for GraalVM distributions (#1146)
* Initial plan * Set GRAALVM_HOME for GraalVM distributions * Rebuild setup action bundle --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
parent
69304e5bab
commit
e07d36bbdd
@@ -166,6 +166,29 @@ describe('GraalVMDistribution', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('setJavaDefault', () => {
|
||||||
|
it('should set GRAALVM_HOME for Oracle GraalVM', () => {
|
||||||
|
(distribution as any).setJavaDefault('17.0.5', '/cached/java/path');
|
||||||
|
|
||||||
|
expect(core.exportVariable).toHaveBeenCalledWith(
|
||||||
|
'GRAALVM_HOME',
|
||||||
|
'/cached/java/path'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should set GRAALVM_HOME for GraalVM Community', () => {
|
||||||
|
(communityDistribution as any).setJavaDefault(
|
||||||
|
'17.0.5',
|
||||||
|
'/cached/java/path'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(core.exportVariable).toHaveBeenCalledWith(
|
||||||
|
'GRAALVM_HOME',
|
||||||
|
'/cached/java/path'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('downloadTool', () => {
|
describe('downloadTool', () => {
|
||||||
const javaRelease = {
|
const javaRelease = {
|
||||||
version: '17.0.5',
|
version: '17.0.5',
|
||||||
|
|||||||
Vendored
+4
@@ -131328,6 +131328,10 @@ class GraalVMDistribution extends JavaBase {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setJavaDefault(version, toolPath) {
|
||||||
|
super.setJavaDefault(version, toolPath);
|
||||||
|
exportVariable('GRAALVM_HOME', toolPath);
|
||||||
|
}
|
||||||
async findPackageForDownload(range) {
|
async findPackageForDownload(range) {
|
||||||
this.validateVersionRange(range);
|
this.validateVersionRange(range);
|
||||||
const arch = this.getSupportedArchitecture();
|
const arch = this.getSupportedArchitecture();
|
||||||
|
|||||||
@@ -110,6 +110,11 @@ export class GraalVMDistribution extends JavaBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected setJavaDefault(version: string, toolPath: string): void {
|
||||||
|
super.setJavaDefault(version, toolPath);
|
||||||
|
core.exportVariable('GRAALVM_HOME', toolPath);
|
||||||
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(
|
||||||
range: string
|
range: string
|
||||||
): Promise<JavaDownloadRelease> {
|
): Promise<JavaDownloadRelease> {
|
||||||
|
|||||||
Reference in New Issue
Block a user