@@ -104157,7 +104157,6 @@ const installer_4 = __nccwpck_require__(8579);
104157104157const installer_5 = __nccwpck_require__(883);
104158104158const installer_6 = __nccwpck_require__(3613);
104159104159const installer_7 = __nccwpck_require__(4750);
104160- const installer_8 = __nccwpck_require__(4298);
104161104160var JavaDistribution;
104162104161(function (JavaDistribution) {
104163104162 JavaDistribution["Adopt"] = "adopt";
@@ -104169,7 +104168,6 @@ var JavaDistribution;
104169104168 JavaDistribution["JdkFile"] = "jdkfile";
104170104169 JavaDistribution["Microsoft"] = "microsoft";
104171104170 JavaDistribution["Corretto"] = "corretto";
104172- JavaDistribution["Oracle"] = "oracle";
104173104171})(JavaDistribution || (JavaDistribution = {}));
104174104172function getJavaDistribution(distributionName, installerOptions, jdkFile) {
104175104173 switch (distributionName) {
@@ -104190,8 +104188,6 @@ function getJavaDistribution(distributionName, installerOptions, jdkFile) {
104190104188 return new installer_6.MicrosoftDistributions(installerOptions);
104191104189 case JavaDistribution.Corretto:
104192104190 return new installer_7.CorrettoDistribution(installerOptions);
104193- case JavaDistribution.Oracle:
104194- return new installer_8.OracleDistribution(installerOptions);
104195104191 default:
104196104192 return null;
104197104193 }
@@ -104599,125 +104595,6 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
104599104595exports.MicrosoftDistributions = MicrosoftDistributions;
104600104596
104601104597
104602- /***/ }),
104603-
104604- /***/ 4298:
104605- /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
104606-
104607- "use strict";
104608-
104609- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
104610- if (k2 === undefined) k2 = k;
104611- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
104612- }) : (function(o, m, k, k2) {
104613- if (k2 === undefined) k2 = k;
104614- o[k2] = m[k];
104615- }));
104616- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
104617- Object.defineProperty(o, "default", { enumerable: true, value: v });
104618- }) : function(o, v) {
104619- o["default"] = v;
104620- });
104621- var __importStar = (this && this.__importStar) || function (mod) {
104622- if (mod && mod.__esModule) return mod;
104623- var result = {};
104624- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
104625- __setModuleDefault(result, mod);
104626- return result;
104627- };
104628- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
104629- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
104630- return new (P || (P = Promise))(function (resolve, reject) {
104631- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
104632- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
104633- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
104634- step((generator = generator.apply(thisArg, _arguments || [])).next());
104635- });
104636- };
104637- var __importDefault = (this && this.__importDefault) || function (mod) {
104638- return (mod && mod.__esModule) ? mod : { "default": mod };
104639- };
104640- Object.defineProperty(exports, "__esModule", ({ value: true }));
104641- exports.OracleDistribution = void 0;
104642- const core = __importStar(__nccwpck_require__(2186));
104643- const tc = __importStar(__nccwpck_require__(7784));
104644- const fs_1 = __importDefault(__nccwpck_require__(7147));
104645- const path_1 = __importDefault(__nccwpck_require__(1017));
104646- const base_installer_1 = __nccwpck_require__(9741);
104647- const util_1 = __nccwpck_require__(2629);
104648- const http_client_1 = __nccwpck_require__(9925);
104649- const ORACLE_DL_BASE = 'https://download.oracle.com/java';
104650- class OracleDistribution extends base_installer_1.JavaBase {
104651- constructor(installerOptions) {
104652- super('Oracle', installerOptions);
104653- }
104654- downloadTool(javaRelease) {
104655- return __awaiter(this, void 0, void 0, function* () {
104656- core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
104657- const javaArchivePath = yield tc.downloadTool(javaRelease.url);
104658- core.info(`Extracting Java archive...`);
104659- let extension = util_1.getDownloadArchiveExtension();
104660- let extractedJavaPath = yield util_1.extractJdkFile(javaArchivePath, extension);
104661- const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
104662- const archivePath = path_1.default.join(extractedJavaPath, archiveName);
104663- const version = this.getToolcacheVersionName(javaRelease.version);
104664- let javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
104665- return { version: javaRelease.version, path: javaPath };
104666- });
104667- }
104668- findPackageForDownload(range) {
104669- return __awaiter(this, void 0, void 0, function* () {
104670- const arch = this.distributionArchitecture();
104671- if (arch !== 'x64' && arch !== 'aarch64') {
104672- throw new Error(`Unsupported architecture: ${this.architecture}`);
104673- }
104674- if (!this.stable) {
104675- throw new Error('Early access versions are not supported');
104676- }
104677- if (this.packageType !== 'jdk') {
104678- throw new Error('Oracle JDK provides only the `jdk` package type');
104679- }
104680- const platform = this.getPlatform();
104681- const extension = util_1.getDownloadArchiveExtension();
104682- let major;
104683- let fileUrl;
104684- if (range.includes('.')) {
104685- major = range.split('.')[0];
104686- fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
104687- }
104688- else {
104689- major = range;
104690- fileUrl = `${ORACLE_DL_BASE}/${range}/latest/jdk-${range}_${platform}-${arch}_bin.${extension}`;
104691- }
104692- if (parseInt(major) < 17) {
104693- throw new Error('Oracle JDK is only supported for JDK 17 and later');
104694- }
104695- const response = yield this.http.head(fileUrl);
104696- if (response.message.statusCode === http_client_1.HttpCodes.NotFound) {
104697- throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
104698- }
104699- if (response.message.statusCode !== http_client_1.HttpCodes.OK) {
104700- throw new Error(`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`);
104701- }
104702- return { url: fileUrl, version: range };
104703- });
104704- }
104705- getPlatform(platform = process.platform) {
104706- switch (platform) {
104707- case 'darwin':
104708- return 'macos';
104709- case 'win32':
104710- return 'windows';
104711- case 'linux':
104712- return 'linux';
104713- default:
104714- throw new Error(`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`);
104715- }
104716- }
104717- }
104718- exports.OracleDistribution = OracleDistribution;
104719-
104720-
104721104598/***/ }),
104722104599
104723104600/***/ 8579:
0 commit comments