forked from actions/setup-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-java.ts
More file actions
24 lines (20 loc) · 764 Bytes
/
Copy pathsetup-java.ts
File metadata and controls
24 lines (20 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import * as core from '@actions/core';
import * as installer from './installer';
import * as path from 'path';
async function run() {
try {
let version = core.getInput('version');
if (!version) {
version = core.getInput('java-version', {required: true});
}
const arch = core.getInput('architecture', {required: true});
const javaPackage = core.getInput('java-package', {required: true});
const jdkFile = core.getInput('jdkFile', {required: false}) || '';
await installer.getJava(version, arch, jdkFile, javaPackage);
const matchersPath = path.join(__dirname, '..', '.github');
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
} catch (error) {
core.setFailed(error.message);
}
}
run();