Merge branch 'adoptium' of https://github.com/joschi/setup-java into adoptium

This commit is contained in:
Maxim Lobanov 2021-08-05 20:04:08 +03:00
commit 4fa0d7379d
3 changed files with 19 additions and 1 deletions

9
dist/setup/index.js vendored
View file

@ -4068,6 +4068,15 @@ class JavaBase {
version = version.replace('-ea.', '+');
stable = false;
}
else if (version.endsWith('-beta')) {
version = version.replace(/-beta$/, '');
stable = false;
}
else if (version.includes('-beta+')) {
// transform '11.0.0-beta+33' -> '11.0.3+33'
version = version.replace('-beta', '');
stable = false;
}
if (!semver_1.default.validRange(version)) {
throw new Error(`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`);
}