Allow java to be found in cache

This commit is contained in:
Danny McCormick 2019-07-10 15:32:33 -04:00
parent 84817402a9
commit 8a70afdf57
2 changed files with 8 additions and 8 deletions

View file

@ -25,11 +25,11 @@ if (!tempDirectory) {
}
export async function getJava(
versionSpec: string,
version: string,
arch: string,
jdkFile: string
): Promise<void> {
let toolPath = tc.find('Java', versionSpec);
let toolPath = tc.find('Java', version);
if (toolPath) {
core.debug(`Tool found in cache ${toolPath}`);
@ -46,10 +46,10 @@ export async function getJava(
tempDir
);
core.debug(`jdk extracted to ${jdkDir}`);
toolPath = await tc.cacheDir(jdkDir, 'Java', versionSpec, arch);
toolPath = await tc.cacheDir(jdkDir, 'Java', `${version}.0.0`, arch);
}
let extendedJavaHome = 'JAVA_HOME_' + versionSpec + '_' + arch;
let extendedJavaHome = 'JAVA_HOME_' + version + '_' + arch;
core.exportVariable('JAVA_HOME', toolPath);
core.exportVariable(extendedJavaHome, toolPath);
core.addPath(path.join(toolPath, 'bin'));