mirror of
https://github.com/actions/setup-java.git
synced 2026-06-24 21:27:41 +00:00
Compare commits
4 Commits
339a5b4163
...
98b691d565
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98b691d565 | ||
|
|
99b8673ff6 | ||
|
|
d87ca55394 | ||
|
|
99163b5ebf |
22
.github/ISSUE_TEMPLATE/new_distribution_request.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/new_distribution_request.md
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
name: New Java distribution template
|
||||
about: Suggest a new Java distribution request
|
||||
title: ''
|
||||
labels: new-distribution
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
**Description:**
|
||||
Describe your proposal.
|
||||
|
||||
**Justification:**
|
||||
Justification or a use case for your proposal.
|
||||
|
||||
**Download URL:**
|
||||
Download URL for a new distribution
|
||||
|
||||
**License:**
|
||||
Link for license for a new distribution
|
||||
|
||||
**Are you willing to submit a PR?**
|
||||
<!--- We accept contributions! -->
|
||||
16
.github/new_distribution_pull_request_template.md
vendored
Normal file
16
.github/new_distribution_pull_request_template.md
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
**Description:**
|
||||
Describe your changes.
|
||||
|
||||
**Related issue:**
|
||||
Add link to the related issue.
|
||||
|
||||
**Download URL:**
|
||||
Download URL for a new distribution
|
||||
|
||||
**License:**
|
||||
Link for license for a new distribution
|
||||
|
||||
**Check list:**
|
||||
- [ ] Mark if documentation changes are required.
|
||||
- [ ] Mark if tests were added or updated to cover the changes.
|
||||
- [ ] Mark if new distribution is being added.
|
||||
11
dist/cleanup/index.js
vendored
11
dist/cleanup/index.js
vendored
@ -88355,15 +88355,16 @@ exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
||||
function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
let javaVersionRegExp;
|
||||
if (versionFile == '.tool-versions') {
|
||||
function getFileName(versionFile) {
|
||||
return path_1.default.basename(versionFile);
|
||||
}
|
||||
const versionFileName = getFileName(versionFile);
|
||||
if (versionFileName == '.tool-versions') {
|
||||
javaVersionRegExp =
|
||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||
}
|
||||
else if (versionFile == '.java-version') {
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid version file');
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
}
|
||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||
|
||||
11
dist/setup/index.js
vendored
11
dist/setup/index.js
vendored
@ -125729,15 +125729,16 @@ exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
|
||||
function getVersionFromFileContent(content, distributionName, versionFile) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
let javaVersionRegExp;
|
||||
if (versionFile == '.tool-versions') {
|
||||
function getFileName(versionFile) {
|
||||
return path_1.default.basename(versionFile);
|
||||
}
|
||||
const versionFileName = getFileName(versionFile);
|
||||
if (versionFileName == '.tool-versions') {
|
||||
javaVersionRegExp =
|
||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||
}
|
||||
else if (versionFile == '.java-version') {
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
}
|
||||
else {
|
||||
throw new Error('Invalid version file');
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
}
|
||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||
|
||||
12
src/util.ts
12
src/util.ts
@ -119,13 +119,17 @@ export function getVersionFromFileContent(
|
||||
versionFile: string
|
||||
): string | null {
|
||||
let javaVersionRegExp: RegExp;
|
||||
if (versionFile == '.tool-versions') {
|
||||
|
||||
function getFileName(versionFile: string) {
|
||||
return path.basename(versionFile);
|
||||
}
|
||||
|
||||
const versionFileName = getFileName(versionFile);
|
||||
if (versionFileName == '.tool-versions') {
|
||||
javaVersionRegExp =
|
||||
/^(java\s+)(?:\S*-)?v?(?<version>(\d+)(\.\d+)?(\.\d+)?(\+\d+)?(-ea(\.\d+)?)?)$/m;
|
||||
} else if (versionFile == '.java-version') {
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
} else {
|
||||
throw new Error('Invalid version file');
|
||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||
}
|
||||
|
||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
||||
|
||||
Loading…
Reference in New Issue
Block a user