2026-07-29 17:53:33 -04:00
export const id = 675 ;
export const ids = [ 675 ] ;
export const modules = {
/***/ 7675 :
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ DragonwellDistribution : ( ) => ( /* binding */ DragonwellDistribution )
/* harmony export */ } ) ;
/* harmony import */ var _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( 3838 ) ;
2026-08-04 23:05:06 -04:00
/* harmony import */ var semver _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( 2088 ) ;
/* harmony import */ var semver _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( semver _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( 9896 ) ;
/* harmony import */ var fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var path _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( 6928 ) ;
/* harmony import */ var path _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( path _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var _base _installer _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( 6242 ) ;
/* harmony import */ var _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( 4527 ) ;
2026-08-05 12:54:41 -04:00
/* harmony import */ var _platform _types _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( 7444 ) ;
2026-07-29 17:53:33 -04:00
2026-08-04 23:05:06 -04:00
class DragonwellDistribution extends _base _installer _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ /* .JavaBase */ . O {
2026-07-29 17:53:33 -04:00
constructor ( installerOptions ) {
super ( 'Dragonwell' , installerOptions ) ;
}
async findPackageForDownload ( version ) {
if ( ! this . stable ) {
throw new Error ( 'Early access versions are not supported by Dragonwell' ) ;
}
if ( this . packageType !== 'jdk' ) {
throw new Error ( 'Dragonwell provides only the `jdk` package type' ) ;
}
const availableVersions = await this . getAvailableVersions ( ) ;
const matchedVersions = availableVersions
. filter ( item => {
2026-08-04 23:05:06 -04:00
return ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .isVersionSatisfies */ . y ) ( version , item . jdk _version ) ;
2026-07-29 17:53:33 -04:00
} )
. map ( item => {
return {
version : item . jdk _version ,
url : item . download _link ,
checksum : item . checksum
? {
algorithm : 'sha256' ,
value : item . checksum
}
: undefined
} ;
} ) ;
if ( ! matchedVersions . length ) {
const availableVersionStrings = availableVersions . map ( item => item . jdk _version ) ;
throw this . createVersionNotFoundError ( version , availableVersionStrings ) ;
}
const resolvedVersion = matchedVersions [ 0 ] ;
return resolvedVersion ;
}
async getAvailableVersions ( ) {
const platform = this . getPlatformOption ( ) ;
const arch = this . distributionArchitecture ( ) ;
let fetchedDragonwellJson = await this . fetchJsonFromPrimaryUrl ( ) ;
if ( ! fetchedDragonwellJson ) {
fetchedDragonwellJson = await this . fetchJsonFromBackupUrl ( ) ;
}
if ( ! fetchedDragonwellJson ) {
throw new Error ( ` Couldn't fetch Dragonwell versions information from both primary and backup urls ` ) ;
}
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( 'Successfully fetched information about available Dragonwell versions' ) ;
const availableVersions = this . parseVersions ( platform , arch , fetchedDragonwellJson ) ;
if ( _actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .isDebug */ . _o ( ) ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .startGroup */ . Oh ( 'Print information about available versions' ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( availableVersions . map ( item => item . jdk _version ) . join ( ', ' ) ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .endGroup */ . N4 ( ) ;
}
return availableVersions ;
}
async downloadTool ( javaRelease ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .info */ . pq ( ` Downloading Java ${ javaRelease . version } ( ${ this . distribution } ) from ${ javaRelease . url } ... ` ) ;
let javaArchivePath = await this . downloadAndVerify ( javaRelease ) ;
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .info */ . pq ( ` Extracting Java archive... ` ) ;
2026-08-04 23:05:06 -04:00
const extension = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .getDownloadArchiveExtension */ . ag ) ( ) ;
2026-07-29 17:53:33 -04:00
if ( process . platform === 'win32' ) {
2026-08-04 23:05:06 -04:00
javaArchivePath = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .renameWinArchive */ . n2 ) ( javaArchivePath ) ;
2026-07-29 17:53:33 -04:00
}
2026-08-04 23:05:06 -04:00
const extractedJavaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .extractJdkFile */ . PE ) ( javaArchivePath , extension ) ;
const archiveName = fs _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default ( ) . readdirSync ( extractedJavaPath ) [ 0 ] ;
const archivePath = path _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default ( ) . join ( extractedJavaPath , archiveName ) ;
2026-07-29 17:53:33 -04:00
const version = this . getToolcacheVersionName ( javaRelease . version ) ;
2026-08-04 23:05:06 -04:00
const javaPath = await ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .cacheJdkDir */ . Vj ) ( archivePath , this . toolcacheFolderName , version , this . architecture ) ;
2026-07-29 17:53:33 -04:00
return { version : javaRelease . version , path : javaPath } ;
}
parseVersions ( platform , arch , dragonwellVersions ) {
const eligibleVersions = [ ] ;
for ( const majorVersion in dragonwellVersions ) {
const majorVersionMap = dragonwellVersions [ majorVersion ] ;
for ( let jdkVersion in majorVersionMap ) {
const jdkVersionMap = majorVersionMap [ jdkVersion ] ;
if ( ! ( platform in jdkVersionMap ) ) {
continue ;
}
const platformMap = jdkVersionMap [ platform ] ;
if ( ! ( arch in platformMap ) ) {
continue ;
}
const archMap = platformMap [ arch ] ;
if ( jdkVersion === 'latest' ) {
continue ;
}
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
// Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools.
const jdkVersionNums = jdkVersion
. replace ( '+' , '.' )
. split ( '.' ) ;
2026-08-04 23:05:06 -04:00
jdkVersion = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .convertVersionToSemver */ . ZY ) ( ` ${ jdkVersionNums . slice ( 0 , 3 ) . join ( '.' ) } . ${ jdkVersionNums [ jdkVersionNums . length - 1 ] } ` ) ;
2026-07-29 17:53:33 -04:00
for ( const edition in archMap ) {
eligibleVersions . push ( {
os : platform ,
architecture : arch ,
jdk _version : jdkVersion ,
checksum : archMap [ edition ] . sha256 ? ? '' ,
download _link : archMap [ edition ] . download _url ,
edition : edition ,
image _type : 'jdk'
} ) ;
break ; // Get the first available link to the JDK. In most cases it should point to the Extended version of JDK, in rare cases like with v17 it points to the Standard version (the only available).
}
}
}
const sortedVersions = this . sortParsedVersions ( eligibleVersions ) ;
return sortedVersions ;
}
// Sorts versions in descending order as by default data in JSON isn't sorted
sortParsedVersions ( eligibleVersions ) {
const sortedVersions = eligibleVersions . sort ( ( versionObj1 , versionObj2 ) => {
const version1 = versionObj1 . jdk _version ;
const version2 = versionObj2 . jdk _version ;
2026-08-04 23:05:06 -04:00
return semver _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default ( ) . compareBuild ( version1 , version2 ) ;
2026-07-29 17:53:33 -04:00
} ) ;
return sortedVersions . reverse ( ) ;
}
getPlatformOption ( ) {
switch ( process . platform ) {
case 'win32' :
return 'windows' ;
2026-08-05 12:54:41 -04:00
case 'linux' :
return ( 0 , _platform _types _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ /* .isAlpineLinux */ . G6 ) ( ) ? 'alpine-linux' : 'linux' ;
2026-07-29 17:53:33 -04:00
default :
return process . platform ;
}
}
async fetchJsonFromPrimaryUrl ( ) {
const primaryUrl = 'https://dragonwell-jdk.io/map_with_checksum.json' ;
try {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Trying to fetch available Dragonwell versions info from the primary url: ${ primaryUrl } ` ) ;
const fetchedDragonwellJson = ( await this . http . getJson ( primaryUrl ) ) . result ;
return fetchedDragonwellJson ;
}
catch ( err ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Fetching Dragonwell versions info from the primary link: ${ primaryUrl } ended up with the error: ${ err . message } ` ) ;
return null ;
}
}
async fetchJsonFromBackupUrl ( ) {
const owner = 'dragonwell-releng' ;
const repository = 'dragonwell-setup-java' ;
const branch = 'main' ;
const filePath = 'releases.json' ;
const backupUrl = ` https://api.github.com/repos/ ${ owner } / ${ repository } /contents/ ${ filePath } ?ref= ${ branch } ` ;
2026-08-04 23:05:06 -04:00
const headers = ( 0 , _util _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ /* .getGitHubHttpHeaders */ . U _ ) ( ) ;
2026-07-29 17:53:33 -04:00
try {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Trying to fetch available Dragonwell versions info from the backup url: ${ backupUrl } ` ) ;
const fetchedDragonwellJson = ( await this . http . getJson ( backupUrl , headers ) ) . result ;
return fetchedDragonwellJson ;
}
catch ( err ) {
_actions _core _ _WEBPACK _IMPORTED _MODULE _0 _ _ /* .debug */ . Yz ( ` Fetching Dragonwell versions info from the backup url: ${ backupUrl } ended up with the error: ${ err . message } ` ) ;
return null ;
}
}
}
/***/ } )
} ;