FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
setup-java/src/setup-java.ts at main · bbranan/setup-java · GitHub
bbranan
/
setup-java
Public
forked from
actions/setup-java
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
setup-java
/
src
/
setup-java.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (45 loc) · 1.79 KB
Breadcrumbs
setup-java
/
src
/
setup-java.ts
Copy path
File metadata and controls
53 lines (45 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
import
*
as
core
from
'@actions/core'
;
import
*
as
auth
from
'./auth'
;
import
{
getBooleanInput
}
from
'./util'
;
import
*
as
constants
from
'./constants'
;
import
{
restore
}
from
'./cache'
;
import
*
as
path
from
'path'
;
import
{
getJavaDistribution
}
from
'./distributions/distribution-factory'
;
import
{
JavaInstallerOptions
}
from
'./distributions/base-models'
;
async
function
run
(
)
{
try
{
const
version
=
core
.
getInput
(
constants
.
INPUT_JAVA_VERSION
,
{
required
:
true
}
)
;
const
distributionName
=
core
.
getInput
(
constants
.
INPUT_DISTRIBUTION
,
{
required
:
true
}
)
;
const
architecture
=
core
.
getInput
(
constants
.
INPUT_ARCHITECTURE
)
;
const
packageType
=
core
.
getInput
(
constants
.
INPUT_JAVA_PACKAGE
)
;
const
jdkFile
=
core
.
getInput
(
constants
.
INPUT_JDK_FILE
)
;
const
cache
=
core
.
getInput
(
constants
.
INPUT_CACHE
)
;
const
checkLatest
=
getBooleanInput
(
constants
.
INPUT_CHECK_LATEST
,
false
)
;
const
installerOptions
:
JavaInstallerOptions
=
{
architecture
,
packageType
,
version
,
checkLatest
}
;
const
distribution
=
getJavaDistribution
(
distributionName
,
installerOptions
,
jdkFile
)
;
if
(
!
distribution
)
{
throw
new
Error
(
`No supported distribution was found for input
${
distributionName
}
`
)
;
}
const
result
=
await
distribution
.
setupJava
(
)
;
core
.
info
(
''
)
;
core
.
info
(
'Java configuration:'
)
;
core
.
info
(
` Distribution:
${
distributionName
}
`
)
;
core
.
info
(
` Version:
${
result
.
version
}
`
)
;
core
.
info
(
` Path:
${
result
.
path
}
`
)
;
core
.
info
(
''
)
;
const
matchersPath
=
path
.
join
(
__dirname
,
'..'
,
'..'
,
'.github'
)
;
core
.
info
(
`##[add-matcher]
${
path
.
join
(
matchersPath
,
'java.json'
)
}
`
)
;
await
auth
.
configureAuthentication
(
)
;
if
(
cache
)
{
await
restore
(
cache
)
;
}
}
catch
(
error
)
{
core
.
setFailed
(
error
.
message
)
;
}
}
run
(
)
;
Back
|
FazBrowse Home
|
New Git URL