( version: string, options: installerInputsOptions, toolchainId = 0 )
| 90 | run(); |
| 91 | |
| 92 | async function installVersion( |
| 93 | version: string, |
| 94 | options: installerInputsOptions, |
| 95 | toolchainId = 0 |
| 96 | ) { |
| 97 | const { |
| 98 | distributionName, |
| 99 | jdkFile, |
| 100 | architecture, |
| 101 | packageType, |
| 102 | checkLatest, |
| 103 | toolchainIds |
| 104 | } = options; |
| 105 | |
| 106 | const installerOptions: JavaInstallerOptions = { |
| 107 | architecture, |
| 108 | packageType, |
| 109 | checkLatest, |
| 110 | version |
| 111 | }; |
| 112 | |
| 113 | const distribution = getJavaDistribution( |
| 114 | distributionName, |
| 115 | installerOptions, |
| 116 | jdkFile |
| 117 | ); |
| 118 | if (!distribution) { |
| 119 | throw new Error( |
| 120 | `No supported distribution was found for input ${distributionName}` |
| 121 | ); |
| 122 | } |
| 123 | |
| 124 | const result = await distribution.setupJava(); |
| 125 | await toolchains.configureToolchains( |
| 126 | version, |
| 127 | distributionName, |
| 128 | result.path, |
| 129 | toolchainIds[toolchainId] |
| 130 | ); |
| 131 | |
| 132 | core.info(''); |
| 133 | core.info('Java configuration:'); |
| 134 | core.info(` Distribution: ${distributionName}`); |
| 135 | core.info(` Version: ${result.version}`); |
| 136 | core.info(` Path: ${result.path}`); |
| 137 | core.info(''); |
| 138 | } |
| 139 | |
| 140 | interface installerInputsOptions { |
| 141 | architecture: string; |
no test coverage detected