mirror of
https://github.com/actions/setup-java.git
synced 2025-06-29 04:24:14 +00:00
Add support for maven/gradle versions
- Essentially use same concepts as jdk install to switch maven and gradle versions if those are defined with config. - Bump to tool-cache 1.3.0 as 1.0.0 tries to use node_modules/@actions/tool-cache/scripts/externals/unzip which doesn't have execute flag so you'd get `Permission denied` - `extractZipNix` in toolkit no longer support relative path so needs to resolve absolute path before passing file to these methods. - Commit has my local build for `index.js` which probably should get recreated but makes it easier to test this from a PR branch. - Fixes #40
This commit is contained in:
parent
b52cd69bd2
commit
7b8939ae83
11 changed files with 5380 additions and 2890 deletions
|
@ -1,5 +1,7 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as installer from './installer';
|
||||
import * as mavenInstaller from './maven-installer';
|
||||
import * as gradleInstaller from './gradle-installer';
|
||||
import * as auth from './auth';
|
||||
import * as path from 'path';
|
||||
|
||||
|
@ -15,6 +17,19 @@ async function run() {
|
|||
|
||||
await installer.getJava(version, arch, jdkFile, javaPackage);
|
||||
|
||||
const mavenVersion = core.getInput('maven-version', {required: false});
|
||||
const mavenFile = core.getInput('maven-file', {required: false}) || '';
|
||||
const mavenMirror = core.getInput('maven-mirror', {required: false});
|
||||
if (mavenVersion) {
|
||||
await mavenInstaller.getMaven(mavenVersion, mavenFile, mavenMirror);
|
||||
}
|
||||
|
||||
const gradleVersion = core.getInput('gradle-version', {required: false});
|
||||
const gradleFile = core.getInput('gradle-file', {required: false}) || '';
|
||||
if (gradleVersion) {
|
||||
await gradleInstaller.getGradle(gradleVersion, gradleFile);
|
||||
}
|
||||
|
||||
const matchersPath = path.join(__dirname, '..', '.github');
|
||||
console.log(`##[add-matcher]${path.join(matchersPath, 'java.json')}`);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue