-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
SetupJavaV4.kt
317 lines (290 loc) · 13.6 KB
/
SetupJavaV4.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
package io.github.typesafegithub.workflows.actions.actions
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Setup Java JDK
*
* Set up a specific version of the Java JDK and add the command-line tools to the PATH
*
* [Action on GitHub](https://github.com/actions/setup-java)
*
* @param javaVersion The Java version to set up. Takes a whole or semver Java version. See examples
* of supported syntax in README file
* @param javaVersionFile The path to the `.java-version` file. See examples of supported syntax in
* README file
* @param distribution Java distribution. See the list of supported distributions in README file
* @param javaPackage The package type (jdk, jre, jdk+fx, jre+fx)
* @param architecture The architecture of the package (defaults to the action runner's
* architecture)
* @param jdkFile Path to where the compressed JDK is located
* @param checkLatest Set this option if you want the action to check for the latest available
* version that satisfies the version spec
* @param serverId ID of the distributionManagement repository in the pom.xml file. Default is
* `github`
* @param serverUsername Environment variable name for the username for authentication to the Apache
* Maven repository. Default is $GITHUB_ACTOR
* @param serverPassword Environment variable name for password or token for authentication to the
* Apache Maven repository. Default is $GITHUB_TOKEN
* @param settingsPath Path to where the settings.xml file will be written. Default is ~/.m2.
* @param overwriteSettings Overwrite the settings.xml file if it exists. Default is "true".
* @param gpgPrivateKey GPG private key to import. Default is empty string.
* @param gpgPassphrase Environment variable name for the GPG private key passphrase. Default is
* $GPG_PASSPHRASE.
* @param cache Name of the build platform to cache dependencies. It can be "maven", "gradle" or
* "sbt".
* @param cacheDependencyPath The path to a dependency file: pom.xml, build.gradle, build.sbt, etc.
* This option can be used with the `cache` option. If this option is omitted, the action searches for
* the dependency file in the entire repository. This option supports wildcards and a list of file
* names for caching multiple dependencies.
* @param jobStatus Workaround to pass job status to post job step. This variable is not intended
* for manual setting
* @param token The token used to authenticate when fetching version manifests hosted on github.com,
* such as for the Microsoft Build of OpenJDK. When running this action on github.com, the default
* value is sufficient. When running on GHES, you can pass a personal access token for github.com if
* you are experiencing rate limiting.
* @param mvnToolchainId Name of Maven Toolchain ID if the default name of
* "${distribution}_${java-version}" is not wanted. See examples of supported syntax in Advanced Usage
* file
* @param mvnToolchainVendor Name of Maven Toolchain Vendor if the default name of "${distribution}"
* is not wanted. See examples of supported syntax in Advanced Usage file
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
public data class SetupJavaV4 private constructor(
/**
* The Java version to set up. Takes a whole or semver Java version. See examples of supported
* syntax in README file
*/
public val javaVersion: String? = null,
/**
* The path to the `.java-version` file. See examples of supported syntax in README file
*/
public val javaVersionFile: String? = null,
/**
* Java distribution. See the list of supported distributions in README file
*/
public val distribution: SetupJavaV4.Distribution,
/**
* The package type (jdk, jre, jdk+fx, jre+fx)
*/
public val javaPackage: SetupJavaV4.JavaPackage? = null,
/**
* The architecture of the package (defaults to the action runner's architecture)
*/
public val architecture: String? = null,
/**
* Path to where the compressed JDK is located
*/
public val jdkFile: String? = null,
/**
* Set this option if you want the action to check for the latest available version that
* satisfies the version spec
*/
public val checkLatest: Boolean? = null,
/**
* ID of the distributionManagement repository in the pom.xml file. Default is `github`
*/
public val serverId: String? = null,
/**
* Environment variable name for the username for authentication to the Apache Maven repository.
* Default is $GITHUB_ACTOR
*/
public val serverUsername: String? = null,
/**
* Environment variable name for password or token for authentication to the Apache Maven
* repository. Default is $GITHUB_TOKEN
*/
public val serverPassword: String? = null,
/**
* Path to where the settings.xml file will be written. Default is ~/.m2.
*/
public val settingsPath: String? = null,
/**
* Overwrite the settings.xml file if it exists. Default is "true".
*/
public val overwriteSettings: Boolean? = null,
/**
* GPG private key to import. Default is empty string.
*/
public val gpgPrivateKey: String? = null,
/**
* Environment variable name for the GPG private key passphrase. Default is $GPG_PASSPHRASE.
*/
public val gpgPassphrase: String? = null,
/**
* Name of the build platform to cache dependencies. It can be "maven", "gradle" or "sbt".
*/
public val cache: SetupJavaV4.BuildPlatform? = null,
/**
* The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used
* with the `cache` option. If this option is omitted, the action searches for the dependency file
* in the entire repository. This option supports wildcards and a list of file names for caching
* multiple dependencies.
*/
public val cacheDependencyPath: String? = null,
/**
* Workaround to pass job status to post job step. This variable is not intended for manual
* setting
*/
public val jobStatus: String? = null,
/**
* The token used to authenticate when fetching version manifests hosted on github.com, such as
* for the Microsoft Build of OpenJDK. When running this action on github.com, the default value is
* sufficient. When running on GHES, you can pass a personal access token for github.com if you are
* experiencing rate limiting.
*/
public val token: String? = null,
/**
* Name of Maven Toolchain ID if the default name of "${distribution}_${java-version}" is not
* wanted. See examples of supported syntax in Advanced Usage file
*/
public val mvnToolchainId: String? = null,
/**
* Name of Maven Toolchain Vendor if the default name of "${distribution}" is not wanted. See
* examples of supported syntax in Advanced Usage file
*/
public val mvnToolchainVendor: String? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<SetupJavaV4.Outputs>("actions", "setup-java", _customVersion ?: "v4") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
javaVersion: String? = null,
javaVersionFile: String? = null,
distribution: SetupJavaV4.Distribution,
javaPackage: SetupJavaV4.JavaPackage? = null,
architecture: String? = null,
jdkFile: String? = null,
checkLatest: Boolean? = null,
serverId: String? = null,
serverUsername: String? = null,
serverPassword: String? = null,
settingsPath: String? = null,
overwriteSettings: Boolean? = null,
gpgPrivateKey: String? = null,
gpgPassphrase: String? = null,
cache: SetupJavaV4.BuildPlatform? = null,
cacheDependencyPath: String? = null,
jobStatus: String? = null,
token: String? = null,
mvnToolchainId: String? = null,
mvnToolchainVendor: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(javaVersion=javaVersion, javaVersionFile=javaVersionFile, distribution=distribution,
javaPackage=javaPackage, architecture=architecture, jdkFile=jdkFile,
checkLatest=checkLatest, serverId=serverId, serverUsername=serverUsername,
serverPassword=serverPassword, settingsPath=settingsPath,
overwriteSettings=overwriteSettings, gpgPrivateKey=gpgPrivateKey,
gpgPassphrase=gpgPassphrase, cache=cache, cacheDependencyPath=cacheDependencyPath,
jobStatus=jobStatus, token=token, mvnToolchainId=mvnToolchainId,
mvnToolchainVendor=mvnToolchainVendor, _customInputs=_customInputs,
_customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
javaVersion?.let { "java-version" to it },
javaVersionFile?.let { "java-version-file" to it },
"distribution" to distribution.stringValue,
javaPackage?.let { "java-package" to it.stringValue },
architecture?.let { "architecture" to it },
jdkFile?.let { "jdkFile" to it },
checkLatest?.let { "check-latest" to it.toString() },
serverId?.let { "server-id" to it },
serverUsername?.let { "server-username" to it },
serverPassword?.let { "server-password" to it },
settingsPath?.let { "settings-path" to it },
overwriteSettings?.let { "overwrite-settings" to it.toString() },
gpgPrivateKey?.let { "gpg-private-key" to it },
gpgPassphrase?.let { "gpg-passphrase" to it },
cache?.let { "cache" to it.stringValue },
cacheDependencyPath?.let { "cache-dependency-path" to it },
jobStatus?.let { "job-status" to it },
token?.let { "token" to it },
mvnToolchainId?.let { "mvn-toolchain-id" to it },
mvnToolchainVendor?.let { "mvn-toolchain-vendor" to it },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public sealed class Distribution(
public val stringValue: String,
) {
public object Adopt : SetupJavaV4.Distribution("adopt")
public object AdoptHotspot : SetupJavaV4.Distribution("adopt-hotspot")
public object AdoptOpenj9 : SetupJavaV4.Distribution("adopt-openj9")
public object Corretto : SetupJavaV4.Distribution("corretto")
public object Liberica : SetupJavaV4.Distribution("liberica")
public object Microsoft : SetupJavaV4.Distribution("microsoft")
public object Temurin : SetupJavaV4.Distribution("temurin")
public object Zulu : SetupJavaV4.Distribution("zulu")
public class Custom(
customStringValue: String,
) : SetupJavaV4.Distribution(customStringValue)
}
public sealed class JavaPackage(
public val stringValue: String,
) {
public object Jdk : SetupJavaV4.JavaPackage("jdk")
public object Jre : SetupJavaV4.JavaPackage("jre")
public object JdkPlusFx : SetupJavaV4.JavaPackage("jdk+fx")
public object JrePlusFx : SetupJavaV4.JavaPackage("jre+fx")
public class Custom(
customStringValue: String,
) : SetupJavaV4.JavaPackage(customStringValue)
}
public sealed class BuildPlatform(
public val stringValue: String,
) {
public object Maven : SetupJavaV4.BuildPlatform("maven")
public object Gradle : SetupJavaV4.BuildPlatform("gradle")
public object Sbt : SetupJavaV4.BuildPlatform("sbt")
public class Custom(
customStringValue: String,
) : SetupJavaV4.BuildPlatform(customStringValue)
}
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* Distribution of Java that has been installed
*/
public val distribution: String = "steps.$stepId.outputs.distribution"
/**
* Actual version of the java environment that has been installed
*/
public val version: String = "steps.$stepId.outputs.version"
/**
* Path to where the java environment has been installed (same as $JAVA_HOME)
*/
public val path: String = "steps.$stepId.outputs.path"
/**
* A boolean value to indicate an exact match was found for the primary key
*/
public val cacheHit: String = "steps.$stepId.outputs.cache-hit"
}
}