MCPcopy Index your code
hub / github.com/actions/setup-java / installVersion

Function installVersion

src/setup-java.ts:92–138  ·  view source on GitHub ↗
(
  version: string,
  options: installerInputsOptions,
  toolchainId = 0
)

Source from the content-addressed store, hash-verified

90run();
91
92async 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
140interface installerInputsOptions {
141 architecture: string;

Callers 1

runFunction · 0.85

Calls 2

getJavaDistributionFunction · 0.90
setupJavaMethod · 0.80

Tested by

no test coverage detected