Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid "+" sign in Java path in v2-preview #145

Merged
merged 12 commits into from
Mar 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more logs
  • Loading branch information
Maxim Lobanov committed Mar 24, 2021
commit d288ea3b36e9ad9792236517ecfd956b9f825704
2 changes: 2 additions & 0 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
@@ -3944,12 +3944,14 @@ class JavaBase {
const availableVersions = tc
.findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable);
console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);
const satisfiedVersions = availableVersions
.filter(item => util_1.isVersionSatisfies(this.version, item.replace(/-ea$/, '').replace('_', '+')))
.sort(semver_1.default.rcompare);
if (!satisfiedVersions || satisfiedVersions.length === 0) {
return null;
}
console.log(`satisfiedVersions = ${JSON.stringify(satisfiedVersions)}`);
const javaPath = util_1.getToolcachePath(this.toolcacheFolderName, satisfiedVersions[0], this.architecture);
if (!javaPath) {
return null;
5 changes: 5 additions & 0 deletions src/distributions/base-installer.ts
Original file line number Diff line number Diff line change
@@ -73,13 +73,18 @@ export abstract class JavaBase {
.findAllVersions(this.toolcacheFolderName, this.architecture)
.filter(item => item.endsWith('-ea') === !this.stable);

console.log(`availableVersions = ${JSON.stringify(availableVersions)}`);

const satisfiedVersions = availableVersions
.filter(item => isVersionSatisfies(this.version, item.replace(/-ea$/, '').replace('_', '+')))
.sort(semver.rcompare);
if (!satisfiedVersions || satisfiedVersions.length === 0) {
return null;
}


console.log(`satisfiedVersions = ${JSON.stringify(satisfiedVersions)}`);

const javaPath = getToolcachePath(
this.toolcacheFolderName,
satisfiedVersions[0],