(
javaRelease: JavaDownloadRelease
)
| 125 | } |
| 126 | |
| 127 | protected async downloadTool( |
| 128 | javaRelease: JavaDownloadRelease |
| 129 | ): Promise<JavaInstallerResults> { |
| 130 | core.info( |
| 131 | `Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...` |
| 132 | ); |
| 133 | let javaArchivePath = await tc.downloadTool(javaRelease.url); |
| 134 | |
| 135 | core.info(`Extracting Java archive...`); |
| 136 | const extension = getDownloadArchiveExtension(); |
| 137 | if (process.platform === 'win32') { |
| 138 | javaArchivePath = renameWinArchive(javaArchivePath); |
| 139 | } |
| 140 | const extractedJavaPath = await extractJdkFile(javaArchivePath, extension); |
| 141 | |
| 142 | const archiveName = fs.readdirSync(extractedJavaPath)[0]; |
| 143 | const archivePath = path.join(extractedJavaPath, archiveName); |
| 144 | const version = this.getToolcacheVersionName(javaRelease.version); |
| 145 | |
| 146 | const javaPath = await tc.cacheDir( |
| 147 | archivePath, |
| 148 | this.toolcacheFolderName, |
| 149 | version, |
| 150 | this.architecture |
| 151 | ); |
| 152 | |
| 153 | return {version: javaRelease.version, path: javaPath}; |
| 154 | } |
| 155 | |
| 156 | protected get toolcacheFolderName(): string { |
| 157 | if (this.jvmImpl === AdoptImplementation.Hotspot) { |
nothing calls this directly
no test coverage detected