mirror of
https://github.com/actions/setup-java.git
synced 2026-11-06 01:40:36 +08:00
* chore(deps): bump the monthly-npm-updates group with 12 updates Bumps the monthly-npm-updates group with 12 updates: | Package | From | To | | --- | --- | --- | | [@actions/cache](https://github.com/actions/toolkit/tree/HEAD/packages/cache) | `6.2.0` | `6.3.0` | | [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) | `5.11.1` | `5.11.2` | | [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `26.6.2` | `26.6.5` | | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.70.1` | `8.72.0` | | [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) | `8.70.1` | `8.72.0` | | [eslint](https://github.com/eslint/eslint) | `10.11.0` | `10.13.0` | | [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) | `29.16.6` | `29.17.0` | | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) | `18.3.0` | `18.5.0` | | [globals](https://github.com/sindresorhus/globals) | `17.12.0` | `17.13.0` | | [lint-staged](https://github.com/lint-staged/lint-staged) | `17.5.1` | `17.6.0` | | [prettier](https://github.com/prettier/prettier) | `3.9.9` | `3.9.10` | | [ts-jest](https://github.com/kulshekhar/ts-jest) | `29.4.13` | `29.4.15` | Updates `@actions/cache` from 6.2.0 to 6.3.0 - [Changelog](https://github.com/actions/toolkit/blob/main/packages/cache/RELEASES.md) - [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/cache) Updates `fast-xml-parser` from 5.11.1 to 5.11.2 - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v5.11.1...v5.11.2) Updates `@types/node` from 26.6.2 to 26.6.5 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Updates `@typescript-eslint/eslint-plugin` from 8.70.1 to 8.72.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.0/packages/eslint-plugin) Updates `@typescript-eslint/parser` from 8.70.1 to 8.72.0 - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v8.72.0/packages/parser) Updates `eslint` from 10.11.0 to 10.13.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/compare/v10.11.0...v10.13.0) Updates `eslint-plugin-jest` from 29.16.6 to 29.17.0 - [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases) - [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v29.16.6...v29.17.0) Updates `eslint-plugin-n` from 18.3.0 to 18.5.0 - [Release notes](https://github.com/eslint-community/eslint-plugin-n/releases) - [Changelog](https://github.com/eslint-community/eslint-plugin-n/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint-community/eslint-plugin-n/compare/v18.3.0...v18.5.0) Updates `globals` from 17.12.0 to 17.13.0 - [Release notes](https://github.com/sindresorhus/globals/releases) - [Commits](https://github.com/sindresorhus/globals/compare/v17.12.0...v17.13.0) Updates `lint-staged` from 17.5.1 to 17.6.0 - [Release notes](https://github.com/lint-staged/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/main/CHANGELOG.md) - [Commits](https://github.com/lint-staged/lint-staged/compare/v17.5.1...v17.6.0) Updates `prettier` from 3.9.9 to 3.9.10 - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.9.9...3.9.10) Updates `ts-jest` from 29.4.13 to 29.4.15 - [Release notes](https://github.com/kulshekhar/ts-jest/releases) - [Changelog](https://github.com/kulshekhar/ts-jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/kulshekhar/ts-jest/compare/v29.4.13...v29.4.15) --- updated-dependencies: - dependency-name: "@actions/cache" dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: fast-xml-parser dependency-version: 5.11.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: monthly-npm-updates - dependency-name: "@types/node" dependency-version: 26.6.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: monthly-npm-updates - dependency-name: "@typescript-eslint/eslint-plugin" dependency-version: 8.72.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: "@typescript-eslint/parser" dependency-version: 8.72.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: eslint dependency-version: 10.13.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: eslint-plugin-jest dependency-version: 29.17.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: eslint-plugin-n dependency-version: 18.5.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: globals dependency-version: 17.13.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: lint-staged dependency-version: 17.6.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: monthly-npm-updates - dependency-name: prettier dependency-version: 3.9.10 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: monthly-npm-updates - dependency-name: ts-jest dependency-version: 29.4.15 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: monthly-npm-updates ... Signed-off-by: dependabot[bot] <support@github.com> * chore: rebuild dist bundles Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * chore: refresh npm license cache Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bruno Borges <brborges@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
138 lines
7.0 KiB
JavaScript
138 lines
7.0 KiB
JavaScript
export const id = 19;
|
|
export const ids = [19];
|
|
export const modules = {
|
|
|
|
/***/ 1019:
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
/* harmony export */ LocalDistribution: () => (/* binding */ LocalDistribution)
|
|
/* harmony export */ });
|
|
/* harmony import */ var _actions_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3838);
|
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9896);
|
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_1__);
|
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6928);
|
|
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_2__);
|
|
/* harmony import */ var _base_installer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6242);
|
|
/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4527);
|
|
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7242);
|
|
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6982);
|
|
/* harmony import */ var crypto__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(crypto__WEBPACK_IMPORTED_MODULE_5__);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LocalDistribution extends _base_installer_js__WEBPACK_IMPORTED_MODULE_3__/* .JavaBase */ .O {
|
|
jdkFile;
|
|
constructor(installerOptions, jdkFile) {
|
|
super('jdkfile', installerOptions);
|
|
this.jdkFile = jdkFile;
|
|
}
|
|
async setupJava() {
|
|
if (this.latest) {
|
|
throw new Error("The 'latest' version alias is not supported for the 'jdkfile' distribution. Please specify a concrete version.");
|
|
}
|
|
if (this.verifySignature) {
|
|
throw new Error(`Input 'verify-signature' is not supported for distribution '${this.distribution}'.`);
|
|
}
|
|
let foundJava = this.forceDownload ? null : this.findInToolcache();
|
|
if (foundJava) {
|
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Resolved Java ${foundJava.version} from tool-cache`);
|
|
}
|
|
else {
|
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Java ${this.version} was not found in tool-cache. Trying to unpack JDK file...`);
|
|
if (!this.jdkFile) {
|
|
throw new Error("'jdkFile' is not specified");
|
|
}
|
|
const jdkFilePath = path__WEBPACK_IMPORTED_MODULE_2___default().resolve(this.jdkFile);
|
|
const stats = fs__WEBPACK_IMPORTED_MODULE_1___default().statSync(jdkFilePath);
|
|
if (!stats.isFile()) {
|
|
throw new Error(`JDK file was not found in path '${jdkFilePath}'`);
|
|
}
|
|
let jdkCache;
|
|
if (this.cacheJdk) {
|
|
const [{ getJdkVerificationIdentity }, source] = await Promise.all([
|
|
Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779)),
|
|
hashFile(jdkFilePath)
|
|
]);
|
|
jdkCache = {
|
|
distribution: this.distribution,
|
|
packageType: this.packageType,
|
|
architecture: this.architecture,
|
|
version: this.version,
|
|
source,
|
|
verification: getJdkVerificationIdentity(false, false),
|
|
path: this.getJdkCachePath(this.version)
|
|
};
|
|
}
|
|
if (!this.forceDownload && jdkCache) {
|
|
const { restoreJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
|
const restored = await restoreJdk(jdkCache);
|
|
const restoredPath = restored
|
|
? this.getRestoredJdkPath(this.version)
|
|
: undefined;
|
|
if (restoredPath) {
|
|
foundJava = {
|
|
version: this.version,
|
|
path: restoredPath
|
|
};
|
|
}
|
|
}
|
|
if (!foundJava) {
|
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Extracting Java from '${jdkFilePath}'`);
|
|
const extractedJavaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .extractJdkFile */ .PE)(jdkFilePath);
|
|
const archiveName = fs__WEBPACK_IMPORTED_MODULE_1___default().readdirSync(extractedJavaPath)[0];
|
|
const archivePath = path__WEBPACK_IMPORTED_MODULE_2___default().join(extractedJavaPath, archiveName);
|
|
const javaVersion = this.version;
|
|
const javaPath = await (0,_util_js__WEBPACK_IMPORTED_MODULE_4__/* .cacheJdkDir */ .Vj)(archivePath, this.toolcacheFolderName, this.getToolcacheVersionName(javaVersion), this.architecture);
|
|
foundJava = {
|
|
version: javaVersion,
|
|
path: javaPath
|
|
};
|
|
if (jdkCache) {
|
|
const { registerJdk } = await Promise.all(/* import() */[__webpack_require__.e(824), __webpack_require__.e(219), __webpack_require__.e(779)]).then(__webpack_require__.bind(__webpack_require__, 5779));
|
|
registerJdk(jdkCache);
|
|
}
|
|
}
|
|
}
|
|
// JDK folder may contain postfix "Contents/Home" on macOS
|
|
const macOSPostfixPath = path__WEBPACK_IMPORTED_MODULE_2___default().join(foundJava.path, _constants_js__WEBPACK_IMPORTED_MODULE_6__/* .MACOS_JAVA_CONTENT_POSTFIX */ .PG);
|
|
if (process.platform === 'darwin' && fs__WEBPACK_IMPORTED_MODULE_1___default().existsSync(macOSPostfixPath)) {
|
|
foundJava.path = macOSPostfixPath;
|
|
}
|
|
if (this.setDefault) {
|
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Setting Java ${foundJava.version} as the default`);
|
|
this.setJavaDefault(foundJava.version, foundJava.path);
|
|
}
|
|
else {
|
|
_actions_core__WEBPACK_IMPORTED_MODULE_0__/* .info */ .pq(`Installing Java ${foundJava.version} (not setting as default)`);
|
|
this.setJavaEnvironment(foundJava.version, foundJava.path);
|
|
}
|
|
return foundJava;
|
|
}
|
|
async findPackageForDownload(version // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
) {
|
|
throw new Error('This method should not be implemented in local file provider');
|
|
}
|
|
async downloadTool(javaRelease // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
) {
|
|
throw new Error('This method should not be implemented in local file provider');
|
|
}
|
|
}
|
|
async function hashFile(file) {
|
|
const hash = (0,crypto__WEBPACK_IMPORTED_MODULE_5__.createHash)('sha256');
|
|
for await (const chunk of (0,fs__WEBPACK_IMPORTED_MODULE_1__.createReadStream)(file)) {
|
|
hash.update(chunk);
|
|
}
|
|
return hash.digest('hex');
|
|
}
|
|
|
|
|
|
/***/ })
|
|
|
|
};
|